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: lossyWAV Development (Read 567414 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

lossyWAV Development

Reply #1200
A progress bar in what sense and to what purpose? I suppose I could append a line to a log file with a "-l <filepath\filename>" type parameter but what would you want it to contain? When running from the command line there is a progress output of sorts which doesn't include the %age complete, rather amount of data processed (duration of WAV file processed) and number of bits removed so far.
A bit more detail as to what you would want to see would be nice.
A progress %age would be more convenient to me while working with dos-screen-output and batchfiles than the up- and downcounting to just 256 MB. When processing a disc image of say 771 MB, it's useless to see the up and downcounting not knowing where it ends. The percentage like flac does is fine.
And while processing I see an 'average' line with info that I would like to save. I'm a list and reports man. Especially in the testperiods it's nice to see what lossywav did with my files. I know most people us xp and foobar, but I'm with win98 on a slower and older computer, which is sufficient for playing my music and surfing.
Thanks for the additional information - I didn't realise that the size was overflowing - will be fixed. As I know the size of the WAV file, it is trivial to put in %age complete. I'll see what I can to to help with the final stats line that you want to save....
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1201
The only thing I could see a percentage being useful for is if someone wants to send that information back into a progress bar in a front-end.  But then...  it's probably just as easy for the person coding the front-end to convert the file size and file completed numbers to percentage... as it would be for Nick.C to do it on his end.

And yeah, either way it's only going to show the percentage for each file, NOT a batch job, cos lossyWAV doesn't know about your batch job.

Although it's much easier to do the same in C or ASM.  I think OggdropXPd does this already, doesn't it?

lossyWAV Development

Reply #1202
A progress %age would be more convenient to me while working with dos-screen-output and batchfiles than the up- and downcounting to just 256 MB. When processing a disc image of say 771 MB, it's useless to see the up and downcounting not knowing where it ends. The percentage like flac does is fine.
And while processing I see an 'average' line with info that I would like to save. I'm a list and reports man. Especially in the testperiods it's nice to see what lossywav did with my files. I know most people us xp and foobar, but I'm with win98 on a slower and older computer, which is sufficient for playing my music and surfing.
Okay, I've modified the MB counter and it shouldn't overflow - I'll test a large WAV file tonight.
A %age counter (x.xx%) has been added which should be enough resolution to see progress on an older computer / large file.
The "total bits removed / total codec blocks" detail has been removed as well.
I was toying with a "time already taken / total time to process completion" predictor - any use to anyone?
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1203
Okay, I've modified the MB counter and it shouldn't overflow - I'll test a large WAV file tonight.
A %age counter (x.xx%) has been added which should be enough resolution to see progress on an older computer / large file.

Great.  No need for the decimals, but OK. It sounds good.
Quote
I was toying with a "time already taken / total time to process completion" predictor - any use to anyone?
Yep. To me. ETA is always nice to know for impatient people with slow machines. (You'll understand I won't use the -below, -low options..)

lossyWAV Development

Reply #1204
I think issuing lossyWAV under the GNU GPL and Copyleft will be better in the long run for the project, so that is my plan. Does the following look acceptable? I will be including a url to the current GNU GPL in the help as well as a copy of GPL.txt in the .zip distribution file, this is somewhat of a work in progress as I have never publicly released software before.

How do these look:
Code: [Select]
lossyWAV v1.0.0, Copyright (C) 2007,2008 Nick Currie. Copyleft.
Issued as free software; License: GNU GPL; Issued with NO WARRANTY WHATSOEVER.

Usage   : lossyWAV <input wav file> <options>

Example : lossyWAV musicfile.wav

Quality Options:

-q <n>        quality preset (10 = highest quality, 0 = lowest bitrate;
              -q 5 is generally accepted to be transparent) default = -q 5.

Standard Options:

-check        check if WAV file has already been processed; default=off.
              errorlevel=16 if already processed, 0 if not.
-correction   write correction file while processing WAV file; default=off.
-force        forcibly over-write output file if it exists; default=off.
-help         display help.
-longhelp     display extended help.
-merge        merge existing lossy.wav and lwcdf.wav files.
-noclips      set allowable number of clips per channel per codec block to 0;
              default: -q 0 to 3 = 3; -q 4 = 2; -q 5 = 1; -q 6 to 10 = 0.
-o <folder>   destination folder for the output file(s).

Special thanks:

David Robinson for the method itself and motivation to implement it.
Don Cross for the original Pascal source for the FFT algorithm used.
Horst Albrecht for valuable tuning input and feedback.


Code: [Select]
lossyWAV v1.0.0, Copyright (C) 2007,2008 Nick Currie. Copyleft.
Issued as free software; License: GNU GPL; Issued with NO WARRANTY WHATSOEVER.

Usage   : lossyWAV <input wav file> <options>

Example : lossyWAV musicfile.wav

Quality Options:

-q <n>        quality preset (10 = highest quality, 0 = lowest bitrate;
              -q 5 is generally accepted to be transparent) default = -q 5.

Standard Options:

-check        check if WAV file has already been processed; default=off.
              errorlevel=16 if already processed, 0 if not.
-correction   write correction file while processing WAV file; default=off.
-force        forcibly over-write output file if it exists; default=off.
-help         display help.
-longhelp     display extended help.
-merge        merge existing lossy.wav and lwcdf.wav files.
-noclips      set allowable number of clips per channel per codec block to 0;
              default: -q 0 to 3 = 3; -q 4 = 2; -q 5 = 1; -q 6 to 10 = 0.
-o <folder>   destination folder for the output file(s).

Advanced Options:

-analyses <n> select number of FFT analysis lengths to use; (2<=n<=5);
              default=2, i.e. 64 sample and 1024 sample FFT analyses;
              (3=2+128 sample FFT; 4=3+256 sample FFT; 5=4+512 sample FFT).
-fft32        enable 32 sample FFT for improved impulse detection;
              defaults: -q 0 to 2 = off; -q 3 to 10 = on.
-minbits <n>  select minimum bits to keep (0.0<=n<=8.0, resolution = 0.01);
              default = (2.9,2.95,3,3.125,3.25,3.375,3.5,3.625,3.75,3.875,4)
-scale <n>    scaling factor from WaveGain / etc; default = 1.000000; n<>0!

System Options:

-detail       enable detailed output mode
-nowarn       suppress lossyWAV warnings.
-quiet        significantly reduce screen output.

-below        set process priority to below normal.
-low          set process priority to low.

Special thanks:

David Robinson for the method itself and motivation to implement it.
Don Cross for the original Pascal source for the FFT algorithm used.
Horst Albrecht for valuable tuning input and feedback.


Code: [Select]
C:\Data_NIC\_WAV\WAV\tmp>lossywav ..\_swavyy\"Jean Michel Jarre - [1976] Oxygene.wav" -q 0 -force
lossyWAV v1.0.0, Copyright (C) 2007,2008 Nick Currie. Copyleft.
Issued as free software; License: GNU GPL; Issued with NO WARRANTY WHATSOEVER.
Processing : Jean Michel Jarre - [1976] Oxygene.wav
Format     : 44.10kHz; 2 ch.; 16 bit.
Progress   : 2.25%, 9.00MB, 4.7743 bits; 9.94x; 5.38s/239.56s;

Code: [Select]
C:\Data_NIC\_WAV\WAV\tmp>lossywav ..\_swavyy\"Jean Michel Jarre - [1976] Oxygene.wav" -q 0 -force
lossyWAV v1.0.0, Copyright (C) 2007,2008 Nick Currie. Copyleft.
Issued as free software; License: GNU GPL; Issued with NO WARRANTY WHATSOEVER.
Processing : Jean Michel Jarre - [1976] Oxygene.wav
Format     : 44.10kHz; 2 ch.; 16 bit.
Average    : 400.56MB; 6.3596 bits; 24.46x; 97.34s;
%lossyWAV Warning% : 6 sample(s) clipped to limiting amplitude.

Code: [Select]
C:\Data_NIC\_WAV\WAV\tmp>lossywav ..\_swavyy\"Jean Michel Jarre - [1976] Oxygene.wav" -q 0 -force -quiet -nowarn
Jean Michel Jarre - [1976] Oxygene.wav; 400.56MB; 6.3596; 23.24x; 102.47s; C:6;
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1205
It looks alright to me.
lossyFLAC (lossyWAV -q 0; FLAC -b 512 -e)

lossyWAV Development

Reply #1206
It looks alright to me.
Thanks, Mitch.

Many thanks to Robert for the pointer to the GNU Coding Standards documentation. Does the following seem to more closely comply?
Code: [Select]
lossyWAV 1.0.0, Copyright (C) 2007,2008 Nick Currie. Copyleft.
Issued as free software; License: GNU GPL; Issued with NO WARRANTY WHATSOEVER.

Usage   : lossyWAV <input wav file> <options>

Example : lossyWAV musicfile.wav

Quality Options:

-q, --quality <n>   quality preset (10=highest quality, 0=lowest bitrate;
                    -q 5 is generally accepted to be transparent)
                    default=-q 5.

Standard Options:

-c, --check         check if WAV file has already been processed; default=off.
                    errorlevel=16 if already processed, 0 if not.
-C, --correction    write correction file for processed WAV file; default=off.
-f, --force         forcibly over-write output file if it exists; default=off.
-h, --help          display help.
-L, --longhelp      display extended help.
-M, --merge         merge existing lossy.wav and lwcdf.wav files.
-N, --noclips       set allowable number of clips / channel / codec block to 0;
                    default=3,3,3,3,2,1,0,0,0,0,0 (-q 0 to -q 10)
-o, --outdir <dir>  destination directory for the output file(s).
-v, --version       display the lossyWAV version number.

Advanced Options:

-a, --analyses <n>  select number of FFT analysis lengths to use; (2<=n<=5);
                    default=2, i.e. 64 sample and 1024 sample FFT analyses;
                    (3=+128 sample FFT; 4=+256 sample FFT; 5=+512 sample FFT).
-F, --fft32         enable 32 sample FFT for improved impulse detection;
                    defaults: -q 0 to 2=off; -q 3 to 10=on.
-m, --minbits <n>   select minimum bits to keep (0.00<=n<=8.00);
                    default=2.9,2.95,3,3.125,3.25,3.375,3.5,3.625,3.75,3.875,4.
-s, --scale <n>     scaling factor from WaveGain, etc; default=1.000000; n<>0!

System Options:

-d, --detail        enable detailed output mode
-n, --nowarnings    suppress lossyWAV warnings.
-Q, --quiet         significantly reduce screen output.

-b, --below         set process priority to below normal.
-l, --low           set process priority to low.

Special thanks:

David Robinson for the method itself and motivation to implement it.
Don Cross for the original Pascal source for the FFT algorithm used.
Horst Albrecht for valuable tuning input and feedback.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1207
Looks good to me


lossyWAV Development

Reply #1209
Is stdin for encoding technically impossible? It would be great if one could live without these temporary files 
Everything else is soo great! Thanks a lot!
flac 1.2.1 -8 (archive) | aoTuVb5.7 -q 4 (pc, s1mp3)

lossyWAV Development

Reply #1210
Is stdin for encoding technically impossible? It would be great if one could live without these temporary files 
Everything else is soo great! Thanks a lot!
I don't think so, I've not tried it in Delphi.... I will certainly add it to the list for 1.1.0, along with noise shaping.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1211
lossyWAV 1.0.0 released.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1212
well, since it's gpl'ed now, can you please make the sourcecode available to me? I want to look into an stdin 'hack' 

thanks
flac 1.2.1 -8 (archive) | aoTuVb5.7 -q 4 (pc, s1mp3)

lossyWAV Development

Reply #1213
well, since it's gpl'ed now, can you please make the sourcecode available to me? I want to look into an stdin 'hack' 

thanks
Yes - I will post the code in post #1 of this thread at lunchtime - I haven't yet added all of the GNU GPL / Copyleft related notices to all of the units. Currently amending the WAV chunk handling to deal properly with unrecognised chunks.

NB: Copyleft means you will have to share the hack  (i.e. save me the trouble of working it out for myself....  ).
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1214
Of course I will do that 
But I can't promise anything... I'm still quite a beginner (but I own Delphi 6 because we need it at school), so please don't depend on it too much.
flac 1.2.1 -8 (archive) | aoTuVb5.7 -q 4 (pc, s1mp3)

lossyWAV Development

Reply #1215
It would be an excellent time to start a new thread when post 1.0 development will begin 
In theory, there is no difference between theory and practice. In practice there is.

lossyWAV Development

Reply #1216
Of course I will do that 
But I can't promise anything... I'm still quite a beginner (but I own Delphi 6 because we need it at school), so please don't depend on it too much.
I have found an "issue" with the --merge parameter for 24-bit files. I will post source as soon as this is amended. Thanks for your patience.

Nick.

@gesomeone: When I have "fixed" 1.0.0 with respect to the WAV chunk issue and the --merge issue, I will indeed start a new thread .
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1217
This post is slightly off-topic.

[...] GNU Coding Standards documentation.

I took the chance to check it again. Granted, it sounds obvious that C is probably the "most used" programming language in the open source community and that you can count on more people willing to help with your C-program simply because there're more programmers capable of doing so. But I think it's not appropriate to apply the same policies to non-GNU software like lossyWAV. It would be "behind the times" to still advocate C over C++ for example. C++ became an ISO standard 10 years ago! There're plenty of good reasons why people should try to move on. RAII is just one example.

Sorry, but I just felt compelled to say this ...

edit: I think the previous comment needs some clarification. I realize that nobody has advocated the use a specific language for lossyWav and I also intend not to do so. It just expresses my personal opinion regarding pros and cons of C and C++ in general.


Cheers,
SG

lossyWAV Development

Reply #1218
lossyWAV 1.0.0b source released, see post #1 in this thread.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1219
I think issuing lossyWAV under the GNU GPL and Copyleft will be better in the long run for the project, so that is my plan.


This was a nice and welcome choice, I think. BTW, what about putting the code in a public repository, so that you can manage the changes? If you want some help with repositories, I think that I can help. This would ease a lot the development and release of the files and also allow the project to gain momentum.

Perhaps a project hosted on SourceForge or BerliOS, with a Subversion repository would be nice, as it would prevent loosing history of the files and directories. I see that you are mostly using it under Windows and don't know C.

I want to use lossyWAV on some of my bootlegs, since I am under severe space constraints. I want this so badly, but:
  • I don't know Windows very well (in fact, I don't even have a Windows machine).
  • I use primarily Unix systems, including Linux and FreeBSD.
  • I do know C reasonably well.
  • I have only a modicum of knowledge of Pascal, from my freshman years at the University.
  • I don't know ia-32 ASM (well, I used to, but I forgot almost everything, since I've been working with higher level languages and algorithms, mostly).
  • I don't know signal processing.
  • I want to use lossyWAV on systems that are not even related to Win32. For instance, I would love to have it working on the 11 architectures that are supported by Debian and, once the code is platform agnostic, I can package it and upload it to Debian's repository, since I will soon be a Debian Maintainer (which sould be real soon now, really).

I think that it would be a good learning excercise for both of us maintaining a version that can be compiled on many Linux distributions (and this means Ubuntu, Gentoo etc users) and also people using MacOS X.

I can start translating some of the .pas files into C (some of them seem quite trivial, while others I don't know). I would welcome help from other people so that we can get this as fast as possible released.

Well, I think that I can contribute to this project in some manner and also learn quite a bit of things and have a way to "give back".

Regards, Rogério Brito.

lossyWAV Development

Reply #1220

I think issuing lossyWAV under the GNU GPL and Copyleft will be better in the long run for the project, so that is my plan.


This was a nice and welcome choice, I think. BTW, what about putting the code in a public repository, so that you can manage the changes? If you want some help with repositories, I think that I can help. This would ease a lot the development and release of the files and also allow the project to gain momentum.
(...)


I can create a sourceforge project, if you wish. I propose it to be called lossywav, uncapitalized, since I don't know if SF handles mixed-case works well. I'm really willing to do things to get some bitrate reduction on my files.

Which version would be checked in as a working/development copy? Oh, and you can use subversion with windows perfectly, as there are clients to this. It seems that tortoisesvn is one client that is made by the people that developed Subversion.


Thanks, Rogério Brito.

lossyWAV Development

Reply #1221
Thanks for your enthusiasm and offer of transcoding skills - v1.1.0b would be the best to start from. There is already a sourceforge project created, it is just empty.

I can revert the IA-32 / x87 assembler to Delphi (though don't hold your breath - I've modified the implementation since it was Delphi, so it will be a transcode back to Delphi rather than a copy and paste). Also, you may be able to replace the nFFTdouble unit with an existing library.

If you wish to take over the management of the sourceforge project, let me know and it's yours....
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV Development

Reply #1222
Thanks for your enthusiasm and offer of transcoding skills - v1.1.0b would be the best to start from. There is already a sourceforge project created, it is just empty.


Hi, Nick. I just checked the page and I think that we can cooperate on that. My id on sourceforge is just "rbrito". I'd be glad to be of help (and to accept patches from other people).

Quote
I can revert the IA-32 / x87 assembler to Delphi (though don't hold your breath - I've modified the implementation since it was Delphi, so it will be a transcode back to Delphi rather than a copy and paste).


Well, any way that you wish. And I hope that you don't mind me asking some pascal questions once in a while...

Quote
Also, you may be able to replace the nFFTdouble unit with an existing library.


It seems that we have a lot of choices regarding FFT... I just checked the repository on Debian and came up with this:

Code: [Select]
fftw-dev - library for computing Fast Fourier Transforms
fftw-docs - documentation for fftw
fftw2 - library for computing Fast Fourier Transforms
libfftw3-3 - library for computing Fast Fourier Transforms
libfftw3-dev - library for computing Fast Fourier Transforms
libfftw3-doc - documentation for fftw version 3
libgsl0ldbl - GNU Scientific Library (GSL) -- library package
mffm-fftw-dev - A C++ wrapper for the fftw.org C library (version 3)
mffm-fftw1c2 - A C++ wrapper for the fftw.org C library (version 3)
sfftw-dev - library for computing Fast Fourier Transforms
sfftw2 - library for computing Fast Fourier Transforms


Quote
If you wish to take over the management of the sourceforge project, let me know and it's yours....


I guess that I don't want to have the entire management, but having it shared... It can be a good learning exercise for both of us, I think.


Thank you for your very warm reply.

Rogério Brito.


Quote

Also, you may be able to replace the nFFTdouble unit with an existing library.


It seems that we have a lot of choices regarding FFT... I just checked the repository on Debian and came up with this:
(...)


Oh, and then, there is Daniel J. Bernstein's fft programs and all his programs are in the public domain, which means that we can incorporate them into lossywav without worrying about the license.

BTW, nice that you chose GPLv3 as a license.


Regards, Rogério Brito.

lossyWAV Development

Reply #1223
Nick,

I know little and understand less, but isn't LGPL "better" for things like codecs that people might want to link into their own software without worrying about licensing issues?

I'm recalling a recent discussion on HA with spoon (dBpoweramp) where he was taking some stick for linking GPL software.

As I say, I don't know what I'm talking about, but I thought I'd mention it anyway!

Cheers,
David.

lossyWAV Development

Reply #1224
I don't see much point in converting to C or C++ since Pascal is portable too.

If there are Delphi-specific bits, Lazarus may provide the solution.

To my understanding, if LossyWAV remains an independant program, then GPL is appropriate. If it becomes a library it would be good to look into LGPL.