Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
102 user(s) are online (80 user(s) are browsing Forums)

Members: 1
Guests: 101

rjd324, more...

Support us!

Headlines

 
  Register To Post  

Is there an AHI And Audio Datatype expert somewhere ?
Quite a regular
Quite a regular


See User information
Hi,

Is there someone that know how to open an audio datatype, load it into memory and use it under AHI.
I'm looking for source code *sample*.

Kindest Regards,
AmiDARK

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Home away from home
Home away from home


See User information
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 ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Quite a regular
Quite a regular


See User information
I already use datatypes to open pictures/images without problems ...
Same for Audio ?

if it's the same, then the problem is now with AHI ...

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Home away from home
Home away from home


See User information
@freddix
As far as i know - yes. By idea working with datatypes should be same for everything.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Not too shy to talk
Not too shy to talk


See User information
Quote:

freddix wrote:
I already use datatypes to open pictures/images without problems ...
Same for Audio ?

if it's the same, then the problem is now with AHI ...


You don't need to care about AHI. Datatypes.library plays the sample for you. You just call the trigger method.

Example: http://thomas-rapp.homepage.t-online.de/examples/dtplay.c


Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Quite a regular
Quite a regular


See User information
@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 :)

kindest Regards,
AmiDARK
http://www.amidark-engine.com

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Not too shy to talk
Not too shy to talk


See User information
I made a new example which plays a melody: http://thomas-rapp.homepage.t-online.de/examples/melody.c

Note that changing the playback period is documented only for OS 3.5 and above.

Edit: tried it and it also works on 3.1.


Edited by thomas on 2011/5/21 19:03:39
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Quite a regular
Quite a regular


See User information
@Thomas :
Thank you for your samples.
The project is on AmigaOS 4.1 ;)

Kindest Regards,
AmiDARK
http://www.amidark-engine.com

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Supreme Council
Supreme Council


See User information
Quote:

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
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Just can't stay away
Just can't stay away


See User information
@Rigo
Quote:

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.

Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Supreme Council
Supreme Council


See User information
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
Go to top
Re: Is there an AHI And Audio Datatype expert somewhere ?
Quite a regular
Quite a regular


See User information
Hi (all)

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 ...

Kindest Regards,
AmiDARK
http://www.amidark-engine.com

All we have to decide is what to do with the time that is given to us.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project