- Home /
Streaming audio AND being able to scrub through song?
Hello guys,
i'm playing music from the storage device with an app deployed for Android.
Edit: The user can choose an audio clip from his/her own music library at runtime.
Now if I'm using
AudioClip GetAudioClip(bool threeD, bool stream)
with the second parameter set to false, the app will freeze for up to a few seconds because obviously the clip is loaded into memory completetely before playing.
If I set this parameter to true there is no freezing and the clips starts playing immediately, however I lose the option to scrub through the song with .time ...
Is there any way to combine these options? The freezing really freaks me out and it's much nicer if the clip starts immediately, however not being able to scrub through the song is not really an option either. :( Isn't it possible to start the stream from a certain position in the song?
How is it done in stand-alone music player apps?
A completely different approach I thought of was to somehow get the audio-stream from the native Android player app and process it as an audioclip in unity. Unfortunately I did not find any information on whether or how this would be possible.
Can you help me out?
Thanks in advance!
It seems that for iOS hardware decoding with Audiotype.AUDIOQUEUE as a third parameter of GetAudioClip might be an option of improving the decoding time. Is there a similar option for Android?
Your answer
Follow this Question
Related Questions
How can i create an AudioClip from byte array? 0 Answers
How to keep music playing when android screen is turned off (or locked)? 0 Answers
How to play a playlist of mp3s randomly? 1 Answer
How to stop music from restarting when reloading scene it began? 0 Answers
Music skips when playing sound effects 2 Answers