From: zonyi b. <zo...@gm...> - 2010-06-28 21:02:11
|
Hallo Members, Is there a way, controlling the pitch (speed of mp3 play) real time and remotely via telnet, or remote control etc? Thanks, Zony |
From: Thomas O. <tho...@or...> - 2010-06-29 08:55:20
Attachments:
signature.asc
|
Am Mon, 28 Jun 2010 22:02:04 +0100 schrieb zonyi besk <zo...@gm...>: > Is there a way, controlling the pitch (speed of mp3 play) real time and > remotely via telnet, or remote control etc? shell$ echo help | mpg123 -R | grep -i pitch @H PITCH <[+|-]value>: adjust playback speed (+0.01 is 1 % faster) In other words: Yes;-) There is a "pitch" command in the remote control interface, to be used via stdin or a fifo socket. That pitch works in the range your audio output allows (in the case of alsa default device: what the software resampler manages). Alrighty then, Thomas. |
From: zonyi b. <zo...@gm...> - 2010-06-29 11:55:26
|
> I tried like that and thought it's not working as theres no audio device > (soundcard). > > pv -L 15000 foo.mp3 | mpg123 --timeout -1 --smooth -q -R --fifo > /dev/shm/mpg123-cmd1 --remote-err -s --wav - | lame - > out.mp3 > echo "SILENCE" > /dev/shm/mpg123-cmd1 > echo "L /dev/stdin" > /dev/shm/mpg123-cmd1 > echo "PITCH 0.8" > /dev/shm/mpg123-cmd1 > > after adding pitch display error message: > Cannot rewind WAV file. File-format isn't fully conform now its created > without pitch > [wav.c:242] error: Format not supported. > [audio.c:625] error: failed to open audio device > > Thanks, > Regards, > Zol > > > > > |
From: Thomas O. <tho...@or...> - 2010-06-29 13:07:23
Attachments:
signature.asc
|
Am Tue, 29 Jun 2010 12:54:40 +0100 schrieb zonyi besk <zo...@gm...>: > > I tried like that and thought it's not working as theres no audio device > > (soundcard). > > > > pv -L 15000 foo.mp3 | mpg123 --timeout -1 --smooth -q -R --fifo > > /dev/shm/mpg123-cmd1 --remote-err -s --wav - | lame - > out.mp3 > > echo "SILENCE" > /dev/shm/mpg123-cmd1 > > echo "L /dev/stdin" > /dev/shm/mpg123-cmd1 > > echo "PITCH 0.8" > /dev/shm/mpg123-cmd1 Whoa. You want to create a pitched WAV? That's not what the pitch hack was intended for. It does work in such a way: mpg123 -w pitched.wav --pitch -0.5 test.mp3 There, it simply creates a WAV file with half the sample rate as the input mp3 has, resulting in downpitch on playback. That also works (note that -s is not needed, it actually conflicts with -w)... mpg123 -w - --pitch 1 -R --remote-err > out.wav @R MPG123 (ThOr) v6 silence @silence load file.mp3 @I low_ao_mix @P 2 @S 1.0 3 44100 Joint-Stereo 2 104 2 0 0 0 32 0 1 @P 0 quit > > Cannot rewind WAV file. File-format isn't fully conform now Yes... that's always the case when writing into a pipe. The length info should be missing, that doesn't have to be fatal. But... as I state below: This kind of writing WAV data is indeed broken, currently:-/ > its created > > without pitch Yeah, the pitch works via the sample rate header entry, and I realize that this might not be correct for writing to a pipe. Actually, I see that it will only default to stereo, 44100 Hz ... hm, I do realize that I should not recommend writing WAV files to stdout as it is now (mpg123 -w - file.mp3 > out.wav works, different from mpg123 -w - file.mp3 | cat > out.wav). The code won't necessarily transport the proper header information... we might fix that in future, but for now you should better go back to plain RAW writing to standard output via -s. > > echo "SILENCE" > /dev/shm/mpg123-cmd1 > > echo "L /dev/stdin" > /dev/shm/mpg123-cmd1 > > echo "PITCH 0.8" > /dev/shm/mpg123-cmd1 And in any case: When you want to have a fixed pitch setting from the beginning, use the --pitch command line parameter. The code above opens the output with the native rate first, then tries to reopen to satisfy the pitch setting. That won't work with WAV output to a pipe. Generally, changing pitch at playtime won't work at all for WAV output, as there is only one header field for a file-wide sampling rate. Well, until the WAV writing to pipes is fixed, you will need to resort to piping via mpg123 -s ... and you then can just tell lame that the input has a different sampling rate to achieve the same pitch effect. Yeah, either pipe through something that resamples for pitching... or tell lame a different input sample rate so that it resamples internally. Alritghty then, Thomas. |
From: zonyi b. <zo...@gm...> - 2010-06-29 15:59:56
|
Thanks much, than would be good if could be converted this raw to mp3 or to other formats with ffmpeg? I thougth somehing like that : mpg123 -s foo.mp3 | ffmpeg -y -f s16le -i - out.mp3 Regards, Zol |
From: zonyi b. <zo...@gm...> - 2010-06-29 17:11:40
|
Hm. > > Tried with raw output but still not changed the pitch. > Tested with mpg123 version 1.12.2 ubuntu 9, amd 64 bit, on a vps, > command-line, without soundcard > > pv -L 30000 foo.mp3 | mpg123 -q -R --fifo /dev/shm/mpg123-cmd1 --remote-err > -s - | lame -x - > out.mp3 > > Zony > |
From: Thomas O. <tho...@or...> - 2010-06-29 19:45:06
Attachments:
signature.asc
|
Am Tue, 29 Jun 2010 18:11:32 +0100 schrieb zonyi besk <zo...@gm...>: > > Tried with raw output but still not changed the pitch. > > pv -L 30000 foo.mp3 | mpg123 -q -R --fifo /dev/shm/mpg123-cmd1 --remote-err > > -s - | lame -x - > out.mp3 Again: The pitch change only affects the choice of sampling rate for the output device of mpg123. It does not change the actual audio data in any way. When you pipe the raw data via -s, there's nothing the pitch command can do. What you can do is to change the sampling rate on the receiving end. mpg123 -q -s file.mp3 | lame -v -r -s 36.030 -m j - out.mp3 Assuming raw pcm input file LAME 3.98.2 64bits (http://www.mp3dev.org/) Resampling: input 36.03 kHz output 32 kHz Using polyphase lowpass filter, transition band: 15613 Hz - 16000 Hz Encoding <stdin> to out.mp3 Encoding as 32 kHz j-stereo MPEG-1 Layer III VBR(q=4) This is exactly what the pitch in mpg123 would have caused if the piping of WAV would be trouble-free. Another appoach would be to resample with another program like sox in the pipe -- that's what pipes are for, in the end. For dynamic run-time pitching to work, one would need to add functionality to mpg123 to really resample the data. I'm not sure if mpg123 really needs that functionality. Alrighty then, Thomas. |