S shashkiranr Active Member Licensed User Longtime User Mar 5, 2017 #1 Hi All, I need to play an audio file from a byte array. I came across where you can set the data source of media player to be of type MediaDataSource. As per the android developer - "For supplying media data to the framework. Implement this if your app has special requirements for the way media data is obtained" I am getting the audio from an external source through the B4J webserver in a custom encoded format. I can decode the stream and want to use the bytes to play the audio without creating a temp audio file. Is there any way to create a MediaDataSource so that I can use it with Media Player.? Kindly let me know. Links: https://developer.android.com/reference/android/media/MediaDataSource.html https://developer.android.com/refer...#setDataSource(android.media.MediaDataSource) Best, SK
Hi All, I need to play an audio file from a byte array. I came across where you can set the data source of media player to be of type MediaDataSource. As per the android developer - "For supplying media data to the framework. Implement this if your app has special requirements for the way media data is obtained" I am getting the audio from an external source through the B4J webserver in a custom encoded format. I can decode the stream and want to use the bytes to play the audio without creating a temp audio file. Is there any way to create a MediaDataSource so that I can use it with Media Player.? Kindly let me know. Links: https://developer.android.com/reference/android/media/MediaDataSource.html https://developer.android.com/refer...#setDataSource(android.media.MediaDataSource) Best, SK
Erel B4X founder Staff member Licensed User Longtime User Mar 5, 2017 #2 I don't think that there is any library available that implements a memory based MediaDataSource. Upvote 0
S shashkiranr Active Member Licensed User Longtime User Mar 8, 2017 #3 Hi Erel, Is it possible to create the datatype using Javaobject or reflection or Inline java? Best, Shashi Kiran Upvote 0
Hi Erel, Is it possible to create the datatype using Javaobject or reflection or Inline java? Best, Shashi Kiran
stevel05 Expert Licensed User Longtime User Mar 8, 2017 #4 If it's decoded to PCM format you can play it directly with the Audiotrack library. https://www.b4x.com/android/forum/threads/audiotrack.14007/ Upvote 0
If it's decoded to PCM format you can play it directly with the Audiotrack library. https://www.b4x.com/android/forum/threads/audiotrack.14007/
S shashkiranr Active Member Licensed User Longtime User Mar 11, 2017 #5 Hi Steve, I have to custom seekbar for which I need to set the secondary progress of the audio file that I am playing and it is not easy to implement with audiotrack or I still have to figure out how to do it and modify it for my current implementation and I am looking into it. @Erel Is there any possibility MediaDataSource will be added in the future for the library? Best, SK Upvote 0
Hi Steve, I have to custom seekbar for which I need to set the secondary progress of the audio file that I am playing and it is not easy to implement with audiotrack or I still have to figure out how to do it and modify it for my current implementation and I am looking into it. @Erel Is there any possibility MediaDataSource will be added in the future for the library? Best, SK
stevel05 Expert Licensed User Longtime User Mar 11, 2017 #6 If your passing data from an array, you already know the position and don't need either library to return it. Upvote 0
If your passing data from an array, you already know the position and don't need either library to return it.