Skip to content

Mix MP3 and generatedSoundStream #1828

Closed Answered by pschatzmann
schromp asked this question in Q&A
Discussion options

You must be logged in to vote

You have 2 major problems to solve:

  • Your speed issue: If you are mixing, you should to make sure that the output info (sample rate, channels, bit_per_sample) of both mixed streams are identical and matches to the one used for i2s: you would usually do this by resampling to a defined target. However I think for white noise you could get away by making sure that you use the right sample rate (from mp3) when you set up i2s or you synchronize them by calling decoder.addNotifyAudioInfo(i2s)
  • you need to feed the mixer with the same data amount and here is where the major challenge lies. You never now how much pcm data a single copierSong.copy(); is producing and in average it is about 4x the a…

Replies: 5 comments 11 replies

Comment options

You must be logged in to vote
3 replies
@schromp
Comment options

@pschatzmann
Comment options

@schromp
Comment options

Answer selected by pschatzmann
Comment options

You must be logged in to vote
3 replies
@schromp
Comment options

@pschatzmann
Comment options

@schromp
Comment options

Comment options

You must be logged in to vote
3 replies
@schromp
Comment options

@pschatzmann
Comment options

@schromp
Comment options

Comment options

You must be logged in to vote
2 replies
@pschatzmann
Comment options

@schromp
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants