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;
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

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.

http://en.wikipedia.org/wiki/Line_level#Connecting_other_devices
--  
    Wulfraed                 Dennis Lee Bieber         AF6VN
     snipped-for-privacy@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Re: perl SDL volume problem
Quoted text here. Click to load it

http://www.raspberrypi.org/wp-content/uploads/2012/10/Raspberry-Pi-R2.0-Schematics-Issue2.2_027.pdf
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


Site Timeline