QMediaPlayer
can be used to play a music file i.e., *.wav, *.mp3, etc. But can I use it to play a wave recorded in an array?
From the official documentation, I found QMediaPlayer::setMedia
has a parameter stream
. I guess this API can be used to play music in an array, however, the documentation doesn't give more details about the stream format or how to construct a stream from a wave array.
(We can assume this array contains float values ranging from -1 to 1 and the sampling rate is a known variable.)