[pulseaudio-discuss] Strange sound when streaming, incorrect sample rate?

sebastian nielsen nielsen.sebastian at gmail.com
Wed Dec 28 01:14:23 PST 2011


Hello.

I have the following in default.pa:

load-module module-pipe-sink format=s16be rate=44100
file=/var/secure_files/cs2dsounds/cs2dsound.01 sink_name=cs2d01
load-module module-esound-protocol-tcp port=64401 listen=127.0.0.1
auth-anonymous=1 auth-ip-acl=127.0.0.0/8 sink=cs2d01

Then I use:

esddsp -s 127.0.0.1:64401 [application name]

to launch.
Cat:ing the cs2dsound.01 file gives me data, eg the screen is flooded
with "incorrect charachters" (since the terminal is incapable of
delivering sound).
So then I know cs2dsound.01 is being filled with data.

Now to the strange thing:

I have the following script hosted in a web server:

#!/usr/bin/perl

local $| = 1;

print "Content-Type: audio/mpeg\n\n";
binmode STDOUT;
open(PIPE, "ffmpeg -f s16be -ar 44100 -i
/var/secure_files/cs2dsounds/cs2dsound.01 -f mp3 pipe:1|");
binmode PIPE;
while (read(PIPE,$data,10)) {
print $data;
}
close(PIPE);


Then I connect with VLC to the adress the script is hosted at.

The strange thing is that the sound is lagged behind 30 seconds AND it
sounds like the sound was slowed down like to 25 % of the original
speed.
Sounds like I use the incorrect sample rate.

The ffmpeg express sample rate in hz.

But in which units do pulseaudio express sample rate? Guess its a
another unit here, since apparently the sample rate is in another
unit.
Or is the problem another?


More information about the pulseaudio-discuss mailing list