Hello,
I have one problem using SDL_mixer library under windows. If anyone can give
any advice I’ll be thankful.
I open SDL_AUDIO with 44 kHz quality and then load my music and play it via
Mix_PlayMusic.
Under Linux everything plays smoothly, but the same code compiled under
windows-xp produces very ugly music with tinkling sounds (like metal noises).
If I changed 44 kHz to 22 kHz, then it plays ok but the quality is worse.
I have SB64 old fashioned soundcard installed on Athlon 1.4 GHz machine.
Can anyone help me?
Thank you in advance.–
Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia
I don’t know if this is related, or even if I’m understanding you
correctly.
But you mentioned that you “open SDL_AUDIO,” as I understand it, using
SDL_mixer, you should rely on SDL_mixer to “open SDL_AUDIO” for you. I
do this in my current project:
Mix_OpenAudio(22050, AUDIO_S16, 2, 1024)
Hope that helps.On Nov 3, 2004, at 2:08 AM, Leonid V. Khramov wrote:
Hello,
I have one problem using SDL_mixer library under windows. If anyone
can give
any advice I’ll be thankful.
I open SDL_AUDIO with 44 kHz quality and then load my music and play
it via
Mix_PlayMusic.
Under Linux everything plays smoothly, but the same code compiled under
windows-xp produces very ugly music with tinkling sounds (like metal
noises).
If I changed 44 kHz to 22 kHz, then it plays ok but the quality is
worse.
I have SB64 old fashioned soundcard installed on Athlon 1.4 GHz
machine.
Can anyone help me?
Thank you in advance.
Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
I do exactly as you wrote except I open audio in 44 kHz:
Mix_OpenAudio(44100, AUDIO_S16, 2, 1024)
Then I call Mix_PlayMusic and it plays perfectly under Linux,
but the same program under windows produces music
with very bad, unpleasant metal sounds.
If I open Mix_OpenAudio(22050, AUDIO_S16, 2, 1024) in 22 kHz
then everything plays fine on both OS (Win & Lin).
Can you explain me why 44 kHz sound is so bad under windows?
Donny Viszneki wrote:> I don’t know if this is related, or even if I’m understanding you
correctly.
But you mentioned that you “open SDL_AUDIO,” as I understand it, using
SDL_mixer, you should rely on SDL_mixer to “open SDL_AUDIO” for you. I
do this in my current project:
Mix_OpenAudio(22050, AUDIO_S16, 2, 1024)
Hope that helps.
On Nov 3, 2004, at 2:08 AM, Leonid V. Khramov wrote:
Hello,
I have one problem using SDL_mixer library under windows. If anyone
can give
any advice I’ll be thankful.
I open SDL_AUDIO with 44 kHz quality and then load my music and play
it via
Mix_PlayMusic.
Under Linux everything plays smoothly, but the same code compiled under
windows-xp produces very ugly music with tinkling sounds (like metal
noises).
If I changed 44 kHz to 22 kHz, then it plays ok but the quality is worse.
I have SB64 old fashioned soundcard installed on Athlon 1.4 GHz machine.
Can anyone help me?
Thank you in advance.
Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
–
Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia
What about with a different buffer size (vs. 1024… e.g. 2048 or 4096)?
It increases latency, but might remove the ‘metal sounds.’ shrug
-bill!
bill at newbreedsoftware.com New Breed Software
http://www.newbreedsoftware.com/ Tux Paint 0.9.14 is out!On Thu, Nov 04, 2004 at 12:54:17PM +0300, Leonid V. Khramov wrote:
I do exactly as you wrote except I open audio in 44 kHz:
Mix_OpenAudio(44100, AUDIO_S16, 2, 1024)
Then I call Mix_PlayMusic and it plays perfectly under Linux,
but the same program under windows produces music
with very bad, unpleasant metal sounds.
Thank you for good advice, I’ve tried 2048 bytes buffer length and
all noises disappeared.
But how could I know that 2048 would be enough for all sound cards
and machines? May be I should set 4096?
Bill Kendrick wrote:> On Thu, Nov 04, 2004 at 12:54:17PM +0300, Leonid V. Khramov wrote:
I do exactly as you wrote except I open audio in 44 kHz:
Mix_OpenAudio(44100, AUDIO_S16, 2, 1024)
Then I call Mix_PlayMusic and it plays perfectly under Linux,
but the same program under windows produces music
with very bad, unpleasant metal sounds.
What about with a different buffer size (vs. 1024… e.g. 2048 or 4096)?
It increases latency, but might remove the ‘metal sounds.’ shrug
-bill!
bill at newbreedsoftware.com New Breed Software
http://www.newbreedsoftware.com/ Tux Paint 0.9.14 is out!
–
Best regards,
Leo
Solvo Ltd.
St.Petersburg, Russia
Well, that’s what I’m bitching about every now and then: You CAN’T!
Every system (OS, hardware, configuration, …) is different.
Of course, if latency is irrelevant, you can decide on some reasonably
safe value (such as the 4096 you suggest), but it’s not totally safe,
and it may be way too much latency for your application.
I’d suggest you decide on a sensible value that should work on most
systems (2048?), and then you add a command line option,
configuration option or something. That way, advanced users can tweak
to their liking, and you have something to suggest to any users who
are having problems with your default setting.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Tuesday 09 November 2004 07.40, Leonid V. Khramov wrote:
Thank you for good advice, I’ve tried 2048 bytes buffer length and
all noises disappeared.
But how could I know that 2048 would be enough for all sound cards
and machines? May be I should set 4096?
Quoting David Olofson :
Well, that’s what I’m bitching about every now and then: You CAN’T!
Every system (OS, hardware, configuration, …) is different.
Of course, if latency is irrelevant, you can decide on some reasonably
safe value (such as the 4096 you suggest), but it’s not totally safe,
and it may be way too much latency for your application.
I’d suggest you decide on a sensible value that should work on most
systems (2048?), and then you add a command line option,
configuration option or something. That way, advanced users can tweak
to their liking, and you have something to suggest to any users who
are having problems with your default setting.
Do you think that the optimum buffer sizes mentioned here are related to the
hardware/drivers being used regardless of format? i.e. would a buffer size of
2048 be equally applicable for a 32KHz mono stream on a platform where it would
be a good size for a 44.1KHz stereo stream?
Fred
It’s hard to know. :^( Too high, and you start getting lots of lag
or other problems.
-bill!On Tue, Nov 09, 2004 at 09:40:36AM +0300, Leonid V. Khramov wrote:
Thank you for good advice, I’ve tried 2048 bytes buffer length and
all noises disappeared.
But how could I know that 2048 would be enough for all sound cards
and machines? May be I should set 4096?
In theory, what matters is the buffer latency; ie how long it takes to
play back one buffer of audio data. That is, you need to scale the
buffer size with sample rate, sample format and number of channels,
to maintain the desired amount of buffering in terms of latency.
However, don’t expect this to be totally accurate on all platforms.
Internal buffering and stuff in the OS and/or drivers may affect
things in weird ways, so don’t rely too heavily on it.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Tuesday 09 November 2004 13.14, fredm at spamcop.net wrote:
Quoting David Olofson <@David_Olofson>:
Well, that’s what I’m bitching about every now and then: You
CAN’T! Every system (OS, hardware, configuration, …) is
different.
Of course, if latency is irrelevant, you can decide on some
reasonably safe value (such as the 4096 you suggest), but it’s
not totally safe, and it may be way too much latency for your
application.
I’d suggest you decide on a sensible value that should work on
most systems (2048?), and then you add a command line option,
configuration option or something. That way, advanced users can
tweak to their liking, and you have something to suggest to any
users who are having problems with your default setting.
Do you think that the optimum buffer sizes mentioned here are
related to the hardware/drivers being used regardless of format?
i.e. would a buffer size of 2048 be equally applicable for a 32KHz
mono stream on a platform where it would be a good size for a
44.1KHz stereo stream?