简体   繁体   中英

Android MediaPlayer.snoop(): How do you get future audio data?

This is something that I'm guessing is impossible without weird work arounds if its possible at all. However,

How would I use snoop() (or something like it) to get audio data for the audio approximately 10 seconds in advance or for the entire audio file(s) playing in the background?

I have little to no idea how this would work. However, one idea was maybe record 10 seconds of audio + audio data (somehow) and delay the playback or just not allow it to play for those ten seconds and then play it 10 seconds later with the audio stuff already recorded. This sounds pretty impossible because I feel like you wouldn't be able to halt or otherwise silence audio playing from a device.

I want to use this for a game in which the player reacts to the songs that they are playing inn their media player. That's why it would be useful to show the user what the audio data looks like before it actually comes up in the song.

Anyway, help would be greatly appreciated and it would improve the game a ton!

Thanks in advance, Karl

The implementations it is very device dependent!

Theoretically will work on all devices and Os, but far away is not true!

I have used the play() in 7 device test on the 8th doesn't worked!

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM