PDA

View Full Version : Shorten files on Windows



bpiela
2005-04-13, 14:06
Hello,

I have a friend that listens to alot of .shn files. As a gift, I would like to purchase a Squeezebox2 for his family. But, in searching through the FAQ, it seems that shorten files are only supported in a Unix environment. Are there any plans on supporting .shn files in a Windows environment? What products will I need to make it work? All comments and opinions are welcome.

Thanks.

kdf
2005-04-13, 21:28
Hello,

I have a friend that listens to alot of .shn files. As a gift, I would like to purchase a Squeezebox2 for his family. But, in searching through the FAQ, it seems that shorten files are only supported in a Unix environment. Are there any plans on supporting .shn files in a Windows environment? What products will I need to make it work? All comments and opinions are welcome.

Thanks.

This depends on someone with some expertise on shorten having a willingness to help. so far, the only well-known way to extract information about a given shorten file (info needed for slimserver to play the file) is to quickly uncompress it to /dev/null. /dev/null, for the non-unix types, is basically a fake device for sending data off into nothingness. This technique lets the server read the WAV header contained in the shorten file and get bitrate, duration, etc. the problem is /dev/null doesn't exist for windows.

Other methods have been hinted at, but nothing clear has been offered up as a solution. My personal searches for info have been fruitless.

-kdf

Philip Meyer
2005-04-14, 01:30
>I have a friend that listens to alot of .shn files.
>
I used to have a lot of .shn files too. However, .flac is a better format, so I converted them.

I used to play .shn files through a plugin for WinAmp. Perhaps you could try finding information on that plugin and see if he could provide any information that might be useful for someone here to produce something for the slimserver?

mkw Audio Compression Tools contains SHN support for converting files to/from .wav. From the readme:

SHNDLL32.DLL
Provides two-way support for shorten, the current de-facto standard in lossless audio compression. SHNDLL32.DLL is the work of Tony Robinson and SoftSound Ltd., and is subject to the shorten license.

So, subject to the license, it may be possible to make some tool that can use this dll to transcode to flac, so that you can keep .shn files but behind the scenes when you select to play them via slimserver, it would decode to .wav and encode back to something else.


I use dbPowerAmp with SHN and FLAC plugins to convert all .shn files to flac. It doesn't take too long at compression level 7 or lower. It has the added benefit that files are slightly smaller and you can add tags to describe the music (.shn doesn't support any tags). dbPowerAmp is integrated into Windows file Explorer, so you can eg. do a file search for all .shn files, and in the search results, select all files, then right-click and select to convert them to flac. Leave the PC for a few hours whilst it uses 100% CPU ;)

Phil

Tiersten
2005-04-14, 08:17
This depends on someone with some expertise on shorten having a willingness to help. so far, the only well-known way to extract information about a given shorten file (info needed for slimserver to play the file) is to quickly uncompress it to /dev/null. /dev/null, for the non-unix types, is basically a fake device for sending data off into nothingness. This technique lets the server read the WAV header contained in the shorten file and get bitrate, duration, etc. the problem is /dev/null doesn't exist for windows.


Can't you use NUL? Thats the equiv of /dev/null for Windows. It exists in every directory as a hidden special file.

- Trevor

kdf
2005-04-14, 09:53
Quoting Tiersten <Tiersten.1nhibb (AT) no-mx (DOT) forums.slimdevices.com>:

>
> kdf Wrote:
> > This depends on someone with some expertise on shorten having a
> > willingness to help. so far, the only well-known way to extract
> > information about a given shorten file (info needed for slimserver to
> > play the file) is to quickly uncompress it to /dev/null. /dev/null,
> > for the non-unix types, is basically a fake device for sending data off
> > into nothingness. This technique lets the server read the WAV header
> > contained in the shorten file and get bitrate, duration, etc. the
> > problem is /dev/null doesn't exist for windows.
> >
>
> Can't you use NUL? Thats the equiv of /dev/null for Windows. It
> exists in every directory as a hidden special file.

That's the first I've ever heard of it, aside from being a constant. Does it
take redirects?

The current method uses the following command line as a filehandle:

"shorten -x \Q$file\E - 2>/dev/null|"

very unixy, and even at that it doesn't seem 100% reliable. Many shorten files
that I've run into fail to work even with this. Any that I've made myself seem
to be ok.

-kdf

Tiersten
2005-04-14, 10:36
That's the first I've ever heard of it, aside from being a constant. Does it
take redirects?


Yes. You can redirect stdout or stderr to it. It'd be 2> nul instead.

kdf
2005-04-14, 11:55
Quoting Tiersten <Tiersten.1nhosn (AT) no-mx (DOT) forums.slimdevices.com>:

>
> kdf Wrote:
> >
> > That's the first I've ever heard of it, aside from being a constant.
> > Does it
> > take redirects?
> >
>
> Yes. You can redirect stdout or stderr to it. It'd be 2> nul instead.

Thanks for the tip. It shows some promise, though it is still reporting an
error getting the WAV header. It is something to play with, however.

-kdf

Michael Scott
2005-04-14, 12:36
Quoting kdf <slim-mail (AT) deane-freeman (DOT) com>:

>> > Can't you use NUL? Thats the equiv of /dev/null for Windows. It
> > exists in every directory as a hidden special file.
>
> That's the first I've ever heard of it, aside from being a constant.
> Does it take redirects?

Yup. It's something else Microsoft "borrowed" from CP/M, who no doubt got it
from another OS

NUL = Null device
CON = Console (keyboard/display)
PRN = Printer

All accept redirects. And the ability to redirect sterror (2>) works with, I
believe, NT and above. Win9x/Me may still be too DOSsy for this.
----------------------
- Mike Scott
- mscott (AT) pyewacket (DOT) org

kdf
2005-04-14, 19:17
Quoting Tiersten <Tiersten.1nhosn (AT) no-mx (DOT) forums.slimdevices.com>:

>
> kdf Wrote:
> >
> > That's the first I've ever heard of it, aside from being a constant.
> > Does it
> > take redirects?
> >
>
> Yes. You can redirect stdout or stderr to it. It'd be 2> nul instead.
>
>
I've just checked in a couple of tweaks to the Shorten handler in slimserver.
Tomorrow's build should perform better under windows. Due to licensing, users
will still have to supply their own copy of the shorten binary. This means
downloading and saving somewhere in your PATH environment variable, or in the
Bin directory where slimserver is installed.

There seems to be two versions floating about. Shortn32.exe has to be renamed
to shorten.exe, and the cygwin version (3.6.0, most recent) needs to have the
cygwin1.dll library saved along with it.

There is still an issue with certain files that seem to have something in the
header that I can't find documented. These work fine as WAV files, but when
piped out, they read wrong. If anyone has tips on that, I'll be happy to
attempt a fix for that too.

-kdf

Roy Owen
2005-04-15, 05:22
Older versions of Windows and DOS you need to specify the actual device ie:
COM1, COM2, LPTx... Although I believe PRN defaults to LPT1. CON and STDOUT
are the same in DOS.

Just some old trivia floating around in an old programmers head...

On 4/14/05, Michael Scott <mscott (AT) pyewacket (DOT) org> wrote:
>
> Quoting kdf <slim-mail (AT) deane-freeman (DOT) com>:
>
> >> > Can't you use NUL? Thats the equiv of /dev/null for Windows. It
> > > exists in every directory as a hidden special file.
> >
> > That's the first I've ever heard of it, aside from being a constant.
> > Does it take redirects?
>
> Yup. It's something else Microsoft "borrowed" from CP/M, who no doubt got
> it
> from another OS
>
> NUL = Null device
> CON = Console (keyboard/display)
> PRN = Printer
>
> All accept redirects. And the ability to redirect sterror (2>) works with,
> I
> believe, NT and above. Win9x/Me may still be too DOSsy for this.
> ----------------------
> - Mike Scott
> - mscott (AT) pyewacket (DOT) org
>