Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ot] set sound on frame

47 views
Skip to first unread message

Prroffessorr Fir Kenobi

unread,
Feb 12, 2017, 3:15:01 AM2/12/17
to
(i know this is oftopic but im searching for some coder experienced in programming sound on pc - maybe some here?
if no skip that message, tnx)

i dont know how exactly sound cards on computers work
(now and then)

i know i can send a .wav with any sample to be played but
i heard it will be played with some delay.. (this delay
comes form driver or hardware, i dont know, probably
driver maybe) .. i heard that this delay is even in a
range of miliseconds (it means is quite big) [im not sure
though as to this information and searching for more info]

whai if i would do instant realtime playing in my games
(prototypes) .. i mean if game is runing with high fps (like 120 or 160 ) i want to calculate and play (and change) sound in each frame [it may sound even like chaos but i would like to
test that]

also i would like to have no human sensible delays, i want source of sound physicaly coordinated with frame displayed
(imagine for example that movie is played at 120 hz and
sound is based on color of current frame and is played with coordinated with this frame display)

is it possible to do that?

Öö Tiib

unread,
Feb 12, 2017, 7:12:14 AM2/12/17
to
On Sunday, 12 February 2017 10:15:01 UTC+2, Prroffessorr Fir Kenobi wrote:
> (i know this is oftopic but im searching for some coder experienced
> in programming sound on pc - maybe some here?

I have tried SDL_mixer some years ago and it worked. I wanted to add
sound effects to a program. It worked fine for what I needed and same
code (and same files) worked on Mac, Windows and Linux and it all felt
quite easy.

If you need experienced people and knowledge of SDL then ...
Forum of SDL: https://forums.libsdl.org/
Wiki of SDL: https://wiki.libsdl.org/

Prroffessorr Fir Kenobi

unread,
Feb 12, 2017, 1:37:21 PM2/12/17
to
ok i will check, here also a bit more words of description what i want:
(quotation from myself)

"imagine i got arcade game with say 5 of 2d starships firing a lot of bulets rapidly (like machine gun fire) (say each one ship fires a bullets that sound in his own sound (different sounds) say also that in each series
(say for 1..50 bullets in one seria) each bullets have slightly different sounds - and assume each bullet sound
is short (dont know 1/10 second sound) need
i just precalculate 5 wav buffers (each one for each chip)
in each buffer precalculate sound for each seria of
bullets (it would be 5 buffers of 50 x 0.1 sec of sounds)
then just point the pointer to location for each ship/bullet and command it to play? i wonder if it
would all play and mix with no visible delay
- where to find some forum for exact answer and how to measure it? (im not quite can to open project and try to test it right now but im very curious for posible delays
and problems here - as i would like to do such kind of realtime generated sounds not jus play rare long tunes)
"

Jorgen Grahn

unread,
Feb 14, 2017, 1:31:16 AM2/14/17
to
On Sun, 2017-02-12, Prroffessorr Fir Kenobi wrote:
> (i know this is oftopic but im searching for some coder experienced
> in programming sound on pc - maybe some here? if no skip that
> message, tnx)
>
> i dont know how exactly sound cards on computers work
> (now and then)
>
> i know i can send a .wav with any sample to be played but
> i heard it will be played with some delay.. (this delay
> comes form driver or hardware, i dont know, probably
> driver maybe) .. i heard that this delay is even in a
> range of miliseconds (it means is quite big) [im not sure
> though as to this information and searching for more info]

Keep this in mind: sound travels arount 340 m in a second, i.e. 0.34 m
in a millisecond. You don't notice any delay in sound (from e.g. a
kid kicking a ball against a wall) unless you are something like 50 m
away.

I think a delay of many, many milliseconds in the driver would be fine.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Prroffessorr Fir Kenobi

unread,
Feb 15, 2017, 11:29:31 AM2/15/17
to
this seem to me to be radically stupid

you mean human ear dont notices delays until it is like 1/7 seconds?
i dont belive it dont know the human ear -delay-sound resolution but i thing it is much more precise
(i know runners start reaction is about 1/10 sec but it is reaction not only you will hear it but 'digest it in mind' then make a move
(and we know how thinking is slow ;c )

Christian Gollwitzer

unread,
Feb 16, 2017, 3:03:11 AM2/16/17
to
Am 15.02.17 um 17:29 schrieb Prroffessorr Fir Kenobi:
> you mean human ear dont notices delays until it is like 1/7 seconds?
> i dont belive it dont know the human ear -delay-sound resolution but i thing it is much more precise

It depends on the exact task. You can try for yourself. There is a
difference between watching a movie and actively producing a sound. When
watching a movie, you can shift the audio delay (for example with VLC
you can shift it by pressing the J and K keys (or G and F on the Mac) in
steps of 50ms. The mismatch is noticeable for me at around 100ms.

Things are much more sensitive if you try to play music together. When
setting up a multistream recorder to record several tracks of a song,
the synchronization must be in the range of 10-20 ms, otherwise it will
be noticeable.

Christian

Prroffessorr Fir Kenobi

unread,
Feb 16, 2017, 11:47:33 AM2/16/17
to
the case im thinking on is more like combining
vision (wisible user or bot actions ) with sound

imagine yu move mouse arrow on a screen with a mouse (mouse arrow is sensitive moves quick) inagine you have bars or lines drawed on the screen and if the mouse arrow croses the line it makes the quick sound - good linking of
vision and sound should make the whole thing
feel physical (maybe) - and i want to achieve such physical feel (delays could spoil that)

well i will need to do some test someday in spare time 9external help would be welcome though)

Jorgen Grahn

unread,
Feb 16, 2017, 1:40:45 PM2/16/17
to
On Wed, 2017-02-15, Prroffessorr Fir Kenobi wrote:
> W dniu wtorek, 14 lutego 2017 07:31:16 UTC+1 użytkownik Jorgen Grahn napisał:
>> On Sun, 2017-02-12, Prroffessorr Fir Kenobi wrote:
...
>> > i know i can send a .wav with any sample to be played but
>> > i heard it will be played with some delay.. (this delay
>> > comes form driver or hardware, i dont know, probably
>> > driver maybe) .. i heard that this delay is even in a
>> > range of miliseconds (it means is quite big) [im not sure
>> > though as to this information and searching for more info]
>>
>> Keep this in mind: sound travels arount 340 m in a second, i.e. 0.34 m
>> in a millisecond. You don't notice any delay in sound (from e.g. a
>> kid kicking a ball against a wall) unless you are something like 50 m
>> away.
>>
>> I think a delay of many, many milliseconds in the driver would be fine.
>>
>> /Jorgen
>>
> this seem to me to be radically stupid

You make me wish I hadn't spent the time trying to help you.
Thanks for clarifying that.

Prroffessorr Fir Kenobi

unread,
Feb 17, 2017, 2:11:50 PM2/17/17
to
no problem - if you spend time on producing radically stupid pices of text in front of people i can help YOU yo make stop that
0 new messages