Sorry can't give you just ready to compile example, but maybe some words about will help : opening of audio datatype the same as opening of any other (so any other example there will help), and then , when its in the memory and decoded, you just play it over AHI.
I assume the real problem is how to exactly works with datatypes ? Or how to play raw data over ahi ?
@Thomas : Interesting but, if I want to force another replay rate than the original one, can I modify the sample object with this ?
I understand with your "small but cute" sample that opening the Datatype sound object is easy, 1. Apparently, I can maybe alter things using SetAttrs( to change replay rate for example, stereo/mono, PAN, etc ... ) 2. And use DoMethod with "STM_PLAY" to play the sample. 3. I can use AllocSignal to have some sort of flag to know when the sample replay is finished ... then I can have my program continue and sound being replayed in some sort of "interrupt" or "background task" ... not ?
Right ?
Thank you for this sample that simplify things a lot for me :) It should help to have the AUDIO command set for the AmiDARK Engine to being finished soonly :)
thomas wrote: You don't need to care about AHI. Datatypes.library plays the sample for you. You just call the trigger method.
Something interesting I noticed when trying out this example. I don't have a soundcard in my AmigaOne, so no sound. I noticed that the DTM_TRIGGER method still returned TRUE even though the sound hardware could not be initialised. This led to the Wait() just waiting forever as the signal is not sent from sound.datatype.
So, it's worth noting here, that while your example works, there is no error checking that works in the event of missing audio hardware. It's probably down to sound.datatype, but until someone takes a look at it, and fixes it, my results are worth considering.
Simon
Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such. ---- http://codebench.co.uk
I noticed that the DTM_TRIGGER method still returned TRUE even though the sound hardware could not be initialised. This led to the Wait() just waiting forever as the signal is not sent from sound.datatype.
So, it's worth noting here, that while your example works, there is no error checking that works in the event of missing audio hardware. It's probably down to sound.datatype, but until someone takes a look at it, and fixes it, my results are worth considering.
I reported that problem on the OS4 Mailing list and in various forums back in 2005. I was eventually referred to Davy Wentzler who forwarded my report to Stephan Rupprecht. When Stephan denied the problem, I modified the example datatype sound playing program from the OS3 SDK and sent it to him to demonstrate the problem. His final response on the issue was:"Any chance that you are using my v41sound.datatype which has exactly this bug?"
I discovered the bug because the same thing happens if you are playing music with a program that uses the low-level AHI API and blocks other sound play. When Davy Wenzel released "device.audio" which allows you to set the AHI "Music unit" to Unit0, the sound blocking problem was eliminated which solved my problem with my sound datatype. However, the problem still exists and you have found another way to demonstrate the bug.
I might add that I have the Jabberwocky datatype sound play routine in a seperate process so that the program doesn't get frozen when this problem occurs. Jabberwocky will just stop playing notification sounds until the program is quit and restarted. That's not an elegant solution; but I expected the bug in sound datatype to be fixed long before now.
Well, as you can imagine by the fact that I don't even have a sound-card in my machine, sound software is not important to me, but now that this has come to my attention and I can reproduce it, I will have a look at it and see if I can do something about it.
Simon
Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such. ---- http://codebench.co.uk
Interesting problem. In my case, I must send sound to be played and get back to the continuum of the program. I already check for AHI device when AmiDARK Engine initialize so, if no AHI cannot be opened, no sound output will be sent ...