Need more information on how to implement RawDataProvider or QueueDataProvider #84
Replies: 1 comment
-
For some reason, GitHub Discussions have actually never notified me. However, the discussion was closed as solved in #86 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Since MiniAudio is a completely new library to me and because I want to try and create an extra backend to a Sound Editor that I've been contributing to since years ago, so I tried implementing MiniAudio into VG Music Studio using the SoundFlow package (which are essentially bindings for MiniAudio). Since I'm used to using PortAudio and NAudio, I literally thought MiniAudio would work in the same way or similar.
But oh wow, I was wrong! lol
I ran into a huge problem: It can output sound, but sounds like one of those old game console crashes, because the buffer doesn't output any sound past the first few buffer arrays. I've tried this with QueueDataProvider and RawDataProvider, and both of them cause the same issue. And every other data provider I've tried expects the buffer to read a RIFF Wave or something, resulting in a decoding error upon reading the array I feed into it.
Here's Mixer.cs, part of the initialisation process:
Mixer.cs
Here's MP2K_Mixer.cs, the other part of the initialisation process and where the data gets fed into it:
MP2KMixer.cs
Then there's Player.cs, the part where the timer and ticks begin from:
Player.cs
Then there's MP2K_Player.cs, which uses the abstract overrides from the Player class to then lead into the mixer:
MP2KPlayer.cs
First, it begins with this (seen in MP2K_Mixer.cs):
Then it enters into Init (seen in Mixer.cs):
Then this runs within a timer thread (seen in Player.cs):
Which then leads to Tick being called in MP2K_Player.cs:
Then leads to Process being called in MP2K_Mixer.cs:
Now, I'm aware that all this code works almost perfectly in PortAudio and NAudio, but as for MiniAudio? The audio gets stuck right at the very beginning. And I'm unsure as to why.
Is there something that I'm missing in the MiniAudio process that I need to do in order to make it work correctly with a buffer array that constantly keeps changing? I really need to know how I can understand how to properly implement it.
I can't see any documentation on how to correctly implement QueueDataProvider or RawDataProvider, so I'd really like to know what I'm missing in this that is needed for a QueueDataProvider or RawDataProvider to work correctly so that the sound will proceed correctly, and not sound like an old game console crash.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions