perl SDL volume problem

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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;
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::Mixer::Channels::volume( -1, 128 );
my $playing_channel = SDL::Mixer::Channels::play_channel( -1,  
$sample,0 );

Dave Saville

Re: perl SDL volume problem
On Tue, 22 Apr 2014 12:30:16 +0000 (UTC), "Dave Saville"

Quoted text here. Click to load it

    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.
    Wulfraed                 Dennis Lee Bieber         AF6VN    HTTP://

Re: perl SDL volume problem
Quoted text here. Click to load it
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  

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

Site Timeline