Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Adjust volume while decoding to wav (Read 5082 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Adjust volume while decoding to wav

Hi
I use the solution from subsonic.org to stream my music to my smartphone and tablet. It's really a great tool, as ypu can decide how your source files should be recoded. I recode my 256 Kbit/s AAC to 112 KBit/s AAC by using qaac with following two steps:

I use this transcoding command:
Step 1: ffmpeg -i %s -f wav -
Step 2: qaac -a %bk --adts - -o -

This works great but replaygain get's lost. Now I'm looking for a solution to change the volume when decoding the files in step 1. FLAC has this feature called "--apply-replaygain-which-is-not-lossless" which is exactly what I want (remember, it's only for streaming!). Does someone know a decoder which supports that too but for decoding aac (and possibly mp3)?

Thanks in advance!

Adjust volume while decoding to wav

Reply #1
I recode my 256 Kbit/s AAC to 112 KBit/s AAC by using qaac
[...]
. FLAC has this feature called "--apply-replaygain-which-is-not-lossless" which is exactly what I want


There's the tool xrecode, that allows a direct conversion to aac or mp3, and adjust the volume on the fly too (in a lossy way, if you wish).

Adjust volume while decoding to wav

Reply #2
AFAIK OP wants streaming, not converting to a file.


Adjust volume while decoding to wav

Reply #4
neroaactag can read and print m4a tags, but you need to use awk or something to extract the gain value for later application.
As for gain application, you can also pipe ffmpeg output to sox and use vol effect of sox. Since sox accepts dB form, you can omit dB->amplitude calculation.

Adjust volume while decoding to wav

Reply #5
Thanks for your help!
@exxtrabigmehdi: I need a codec/tool which supports stdout (as lvqcl mentioned) and I don't know if xrecode supports that. But I contacted the developer.

@lvqcl: Correct, thanks for pointing that out! Since xrecode can be run by commandline it's maybe possible that it supports stdout? As I said I asked the developer.

@phofman: Thanks for the link. This might be a solution. I'll try to script something as soon as I find some time.

@nu774: Thanks for that. This might be a solution too.

Adjust volume while decoding to wav

Reply #6
Big_Berny, what OS do you use? I assume windows due to qaac and xrecode...

Adjust volume while decoding to wav

Reply #7
Yes, I use windows.

Adjust volume while decoding to wav

Reply #8
I thought it would be simple - just making a named pipe in place of the file and reading the pipe to stdout of the script. Oops, no named pipes of that type in your OS 

Depending how much time and effort you want to put into solution, you might want to play with tail -f of http://sourceforge.net/projects/unxutils/ and background processes in cmd scripts http://stackoverflow.com/questions/1449188...-asynchronously .

Adjust volume while decoding to wav

Reply #9
Uff... Looks more complicated as I expected. So there is no easy way to script in windowS?

Adjust volume while decoding to wav

Reply #10
I've just noticed that xrecode now support stdout according to the changelog (well,  this feature was added a month ago) . If you have other feature request, don't hesitate to contact the developper again, they are often considered.