There is a link to the online radio http://variant.fm:8000/LOVE-32 . The application implemented playing this audio stream using exoplayer . I press the playlist - the playback starts, and when I press the stop, it stops. This is all good.

I want to make two more buttons "Record" and "Stop". Clicking on the recording should begin recording in the file of this stream, and when you click on the stop recording ends.

For example, a stream is played and a recording is clicked: an mp3 file was created on the phone in some folder, and until a stop was pressed, a stream is recorded in this file, and when the stop is clicked, the recording stops, and we have the final mp3 file.

How to implement this? Tell me, please, what articles to read, what examples to see? In many applications, online radio in the playmarket has implemented this, and I want to implement the same functionality in my application.

  • No one will help? - Natalia Sergeevna

2 answers 2

In the documentation of the player, I did not find the opportunity to process the incoming stream, it may be worth trying other players before making my own recording implementation. To work with audio streams, you will need android-ffmpeg , to work with mp3 mp3agic structure.

  • I know that I need to save byte by bye, but I don’t know how to implement it. It seems to me that you do not need to think about what is happening on the server. - Natalia Sergeevna
  • @NatalyaSergeevna You need to understand the format of mp3 first, take the byte stream and add the structure of the mp3 file on the client side is likely to be more difficult than to implement on the server side - DaysLikeThis
  • @ NataliaSergeevna, for example, if you really want to implement it on the client side, then the first link from Google leads to stackoverflow.com/questions/43501286/… - DaysLikeThis
  • I do not understand why you are writing about the client and server side. There are many applications "Online Radio", which implemented the ability to record a song being played. I tried to decompile several such applications and did not see that there is some kind of client implementation or server application. In one project there is a byte saving, but the code there will turn out to be a curve and it is difficult to understand this code very much. - Natalia Sergeevna
  • one
    @ NatalyaSergeevna because based on your question it was not clear whether you are developing a website and an application or just an application. Now everything is clear. You will need 2 libraries - github.com/guardianproject/android-ffmpeg for working with stream audio and the second github.com/mpatric/mp3agic for setting and editing mp3 tags, because stream from radio or other internet sources in 90% of cases goes without additional meta info - DaysLikeThis

Exoplayer, as the developers say , does not support recording the audio stream, the best solution would be to find another library.

  • Any suggestions for other libraries? - Natalia Sergeevna