perl SDL volume problem

Trying to use the perl SDL::* modules to play wav clips and I can't get a decent volume on the headphone o/p.

SDL::Mixer::Channels::volume( -1, 128 );

Does not make any difference although using less than 128 for the volume makes it even quieter.

use strict; use warnings; use SDL; use Carp; use SDL::Audio; use SDL::Mixer; use SDL::Mixer::Samples; use SDL::Mixer::Channels; SDL::init(SDL_INIT_AUDIO); unless( SDL::Mixer::open_audio( 44100, AUDIO_S16SYS, 2, 4096 ) == 0 ){ Carp::croak "Can't open audio: ".SDL::get_error();} my $sample = SDL::Mixer::Samples::load_WAV('wm_tell.wav'); unless($sample){ Carp::croak "Can't load wav file: ".SDL::get_error();} SDL::Mixer::Channels::volume( -1, 128 ); my $playing_channel = SDL::Mixer::Channels::play_channel( -1, $sample,0 ); sleep(3); SDL::Mixer::close_audio();

TIA

--
Regards 
Dave Saville
Reply to
Dave Saville
Loading thread data ...

On Tue, 22 Apr 2014 12:30:16 +0000 (UTC), "Dave Saville" declaimed the following:

I don't own one but... Is that really a HEADPHONE output, or something more of a LINE OUT... The two use vastly different definitions.

formatting link

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/
Reply to
Dennis Lee Bieber

formatting link
page 2 bottom right, is the network behind the audio jack.

It has impedance of about 100 ohms so headphones with less than 50 ohms impedance will not work well.

if you don't want to spend tens of dollars on headphones try these loudspeakers farnell part number 599268 or 1192971 or find a usb powered amplifier.

--
umop apisdn
Reply to
Jasen Betts

No guys, thanks but you don't understand the problem. Just using SDL volume controls I can't get the volume above a whisper. But if I

*first* invoke "amixer sset PCM 100%" (From memory) Then it blasts out for the *same* SDL volume setting. So it would appear that SDL cannot alter the "master" volume.
--
Regards 
Dave Saville
Reply to
Dave Saville

Makes sense - you wouldn't want everything suddenly loud just because you started an app, would you?

Reply to
Rob Morley

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.