Author |
Topic: wav files (Read 405 times) |
|
vbi
Guest
|
 |
Re: wav files
« Reply #16 on: Mar 8th, 2018, 1:35pm » |
|
Hello Richard,
Yes, I agree, the majority of the changes made in that example are to allow for a verbose display of what is going on, to hopefully make any failures that occur clearer.
However, there is one important change, which is the addition of the line in PROCCleanup to force @hwo% to FALSE, therefore ensuring that the SDL_OpenAudioDevice gets re-run the next time around to take account of any changes in AudioSpecRequired{} structure.
This point was why I added the note to highlight that changes had been made to all FN/PROCs.
Over to you, Roy!
|
|
Logged
|
|
|
|
roy
New Member
member is offline


Posts: 44
|
 |
Re: wav files
« Reply #17 on: Mar 8th, 2018, 3:14pm » |
|
Hi Richard
Thanks for the link. Believe it or not I did look on Google, but found nothing that help me!
Hi vbi
Thanks for the modified code. It works very well on the laptop and on my tablet
So it's a wow.wav from me.
Many thanks to both of you Regards Roy
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 803
|
 |
Re: wav files
« Reply #18 on: Mar 8th, 2018, 7:09pm » |
|
on Mar 8th, 2018, 1:35pm, vbi wrote:| However, there is one important change, which is the addition of the line in PROCCleanup to force @hwo% to FALSE, therefore ensuring that the SDL_OpenAudioDevice gets re-run the next time around |
|
This question appeared on the SDL forum today. Assuming that it wasn't posted by you (!) it appears to be relevant to this discussion.
What I don't understand, and hopefully it may be explained there, is that in all the examples I have seen AudioSpecObtained{} is identical to AudioSpecRequired{}. I had assumed that if you don't close-and-re-open the audio device (which is undesirable because of the potential for clicks etc.) it would automatically convert the supplied format into whatever the output requires. This would also be important if the OS doesn't accept the source format without conversion.
It's not even clear that the initialisation of AudioSpecRequired{} has any effect at all!
Richard.
|
|
|
|
vbi
Guest
|
 |
Re: wav files
« Reply #19 on: Mar 8th, 2018, 10:37pm » |
|
Hello Richard,
Quote:| This question appeared on the SDL forum today. Assuming that it wasn't posted by you (!) |
|
No, it wasn't me - I'm just a dabbler, utilising Roy's problem as my daily brain teaser. It's a good question though!
From my limited observations, I could believe that the understanding that the poster has set out seems to be entirely plausible. However, my lack of experience in these things led me not even to consider the potential for clicks to be generated on opening and closing the audio device more than is necessary (the benefits of ignorance, perhaps?!).
Quote:| It's not even clear that the initialisation of AudioSpecRequired{} has any effect at all! |
|
I assume you are referring to placing any parameters into AudioSpecRequired{} before calling SDL_LoadWAV_RW? If so I would agree. In fact I did take those lines out at one point, but put them back in a moment of self doubt because I thought that you must have put them there originally for a reason beyond my limited understanding of the SDL API.
It will be interesting to see what answer(s) come back to that question.
|
|
Logged
|
|
|
|
|