Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, degenerate_762), 1,309 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Start playing sound after second... #434059
12/11/13 14:31
12/11/13 14:31
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hi, I need to start a sound not at the beginning of the file, but after a defined second.
And also I need to get the seconds of the whole sound file.
I start playing the sound with snd_play().

As an Example I have the file test.ogg the sound length is 20 seconds. How can I get this value and is it possible to start at an other second than 0 ?

Re: Start playing sound after second... [Re: Benni003] #434064
12/11/13 15:49
12/11/13 15:49
Joined: Dec 2013
Posts: 10
RLP, Germany
ThunderStorm Offline
Newbie
ThunderStorm  Offline
Newbie

Joined: Dec 2013
Posts: 10
RLP, Germany
With snd_playing() you can get the current play-position of the sound-file.

EDIT: re-read your question and now see, that I missed the point.
Maybe you should use a sound-editor and cut the sound as you want.

Last edited by ThunderStorm; 12/11/13 15:52.
Re: Start playing sound after second... [Re: ThunderStorm] #434066
12/11/13 15:56
12/11/13 15:56
Joined: Dec 2013
Posts: 10
RLP, Germany
ThunderStorm Offline
Newbie
ThunderStorm  Offline
Newbie

Joined: Dec 2013
Posts: 10
RLP, Germany
You can use snd_buffer(SOUND* snd, void** pDesc, void*** ppSample) for that.
Never used it, but a look into the manual may be helpful.

Re: Start playing sound after second... [Re: ThunderStorm] #434092
12/12/13 10:23
12/12/13 10:23
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Thank you for your answers. I think snd_buffer() could work. Please could anyone write me a short example? I don't have experiences with handling buffers and I don't want to make something wrong in this point.

1. Getting the seconds of a sounds (full length)
2. start playing the sound from a certain second on.

Re: Start playing sound after second... [Re: Benni003] #434119
12/13/13 09:17
12/13/13 09:17
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
could anyone help me in this point please?
I really need to do this soon smirk

Re: Start playing sound after second... [Re: Benni003] #434129
12/13/13 22:40
12/13/13 22:40
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Iirc, A8 is using OpenAL, so I would be a little bit surprised if this method would still work. But yeah, otherwise it seems like you just have to provide PCM packages? So, grab the bitrate, depth and the packages and skim forward until you are at your point of interest. The math is well described on the internet.

Quote:
I really need to do this soon

That's nice, but it doesn't mean that we need to write code for you. If you need something urgently, pay someone for it. Or wait like everyone else until someone has the time and enthusiasm to write code for you for free wink


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Start playing sound after second... [Re: WretchedSid] #434133
12/14/13 04:16
12/14/13 04:16
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
A8 is using OpenAL

If you create OAL sounds, yes, which is a different instruction than the regular snd_create.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Start playing sound after second... [Re: Superku] #434135
12/14/13 05:41
12/14/13 05:41
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Geez, did JCL become a PHP developer?!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1