Showing results for 
Search instead for 
Do you mean 
Reply
SanDisk Guru
Tapeworm
Posts: 15,096
Registered: ‎04-17-2008
0

Re: Left and right channels reversed when playing .WAV files

OK, maybe it has something to do with the fact that you split them up into smaller files. Whatever, I would re-rip them, possibly with both the ripping program used the first time and another one to hopefully isolate the cause.

 

It will take less time than you're spending in this back & forth asking what it could be. :smileywink:

 

And as Miikerman asked before . . . other than the fact that it is "wrong', does it really matter or bother you that much? Does it irreparably affect your ability to enjoy the music?

SanDisk Guru
saratoga
Posts: 1,145
Registered: ‎04-24-2009
0

Re: Left and right channels reversed when playing .WAV files

Your best bet is probably to just use FLAC or Rockbox (or both since battery life is terrible if you use FLAC without rockbox).  

 

That said I'm vaguely curious about those files, so if you post a download link that doesn't involve me waiding through 1000 porn ads I might take a look at it.

Newbie
xcvbnm
Posts: 9
Registered: ‎09-25-2011
0

Re: Left and right channels reversed when playing .WAV files

[ Edited ]
SanDisk Guru
Tapeworm
Posts: 15,096
Registered: ‎04-17-2008
0

Re: Left and right channels reversed when playing .WAV files

So exactly what should we be listening for to determine if it's playing correctly or is 'reversed'?

Newbie
xcvbnm
Posts: 9
Registered: ‎09-25-2011
0

Re: Left and right channels reversed when playing .WAV files

[ Edited ]

Use VLC Media Player to play the files.
The smaller file has a voice saying "Left" and "Right"; when the voice says "Left", the sound comes from the left, and when the voice says "Right", the sound comes from the right.
The bigger file has music where the singer's voice clearly comes from the left.
Now, copy both files onto Sansa Clip Plus V01.02.15A, disconnect Sansa from the computer, disconnect the headphones from the computer's headphone jack, connect the headphones to the Sansa's headphone jack, and press Sansa's Play button.
The voice saying "Left" will be heard from the right, the voice saying "Right" will be heard from the left, and the singer's voice will be coming from the right.

These files will also freeze Sansa when they finish playing.

SanDisk Guru
JK98
Posts: 2,766
Registered: ‎09-13-2008
0

Re: Left and right channels reversed when playing .WAV files

The specifications for the player don't even claim .WAV support. There is some basic wav support since that is what the player records in, however there is no claim that the player will play .WAV files other than the ones it recorded. Next time if you want a player with .WAV support, then choose one that lists WAV support as a specification. Very few players support .WAV, however many digital recorders support WAV.

SanDisk Guru
Tapeworm
Posts: 15,096
Registered: ‎04-17-2008
0

Re: Left and right channels reversed when playing .WAV files

[ Edited ]

There's something definitely wonky with those files!

 

I don't have VLC (and wasn't about to download another program to try them out), but tried to play them in Windows Media Player. I got an error message saying WMP couldn't play it because it was an unsupported file type. WMP does indeed support WAV files and I have others that play perfectly fine through it.

 

However, even as this error message was displaying, the L_REV_2.WAV file would play; and the voice came out of the left speaker. Funny thing though, the time listed for the file (in WMP) was over 4 minutes and in actuality it is only like 17 seconds long (if I'm remembering correctly). The L_REV_1.WAV file wouldn't play at all.

 

I then fired up Winamp. Both files played fine and the appropriate sound came out of the appropriate speaker. Winamp gave me no error messages.

 

I then transferred the files to my Clip+ (with the .15 firmware) to both the internal memory and external memory card, plugged in my earphones (taking special note to get the right phone in the right ear and left phone in the left ear) to have a listen. Sure enough as you said, the left channel was playing in the right ear. The L_REV_1.WAV file did also indeed freeze up the player, requiring a reset but the L_REV_2.WAV file did not.

 

Interestingly, remember how this file showed in WMP as being over 4 minutes long? Well, on my Clip it showed the correct time (17 secs.) but what was strange was that the progress bar did not move as it normally does when advancing through a song.

 

This behavior occurred with the files being played from both the internal memory and card. I believe I mentioned I've checked several other WAV files and they seem to play without incident on the Clip+. I'm not sure where you got these files, or from what program they were ripped through, but it looks like this is where the problem is, not with the Clip+ player. The fault lies with the files themselves. I would re-download the files and not try to split or otherwise change them, and/or try a different ripping program.

SanDisk Guru
saratoga
Posts: 1,145
Registered: ‎04-24-2009
0

Re: Left and right channels reversed when playing .WAV files


Tapeworm wrote:

 

However, even as this error message was displaying, the L_REV_2.WAV file would play; and the voice came out of the left speaker. Funny thing though, the time listed for the file (in WMP) was over 4 minutes and in actuality it is only like 17 seconds long (if I'm remembering correctly). The L_REV_1.WAV file wouldn't play at all.

 



The file is truncated, so the header indicates its much larger.  A lot of software will ignore this (since the length of a WAV file is trivially calculated from the sample rate, bitdepth and file size) so its not usually a problem.  

 

The real problem is probably that the file has a lot of metadata in the header in various info chunks.  These are not widely supported, so the Sandisk firmware may not expect them.  By chance the metadata in the header of the first file extends the header so that its length is divisible by 2, but not divisiable by 4.  A PCM sample is 2 bytes in this file, and 2 are put together to make a 4 byte stereo pair.  Since the left channel starts shifted over by 2 bytes, the very first sample is lost and all subsequent ones are swapped (the first left sample is skipped, first right becomes the first left sample, second left becomes first right, ...).

 

Theres basically two solutions here:

 

1) Remove all these weird headers from your WAV files, or at least make sure that each WAV file has an amount of metadata added thats divisible by 4 bytes.  I don't have my clip handy, but I bet if you just insert two bytes starting at byte 250 in that file it will play correctly in the sandisk software.  

 

2) Use rockbox, which understands metadata in WAV files, and thus will not be confused by it.  I've verified that our WAV parser correctly handles the example file and does not flip the channels.  Likewise VLC does the same (and also helpfully prints out the file tags).    

 

 

Newbie
xcvbnm
Posts: 9
Registered: ‎09-25-2011
0

Re: Left and right channels reversed when playing .WAV files

    I didn't touch the headers. They are not weird. These are the headers produced by well known, reputable CD ripping programs that thousands of other people use. Which means, for one thing, that there are thousands of files ripped by thousands of people out there with the same exact headers, and all those files will play with the channels reversed.
    Now, I'd like to address the contention that the headers are not widely supported, and Sandisk firmware does not expect them. Let's take a very, very old version of, say, Windows Media Player. Clearly, that old version will know nothing about these modern headers. My question is, does this mean that that old version of Windows Media Player will play the files with the channels reversed? I didn't do such testing, and I don't know the answer. However, if the answer is no, you'll have to admit that this is a Sansa firmware bug after all.

SanDisk Guru
saratoga
Posts: 1,145
Registered: ‎04-24-2009
0

Re: Left and right channels reversed when playing .WAV files


xcvbnm wrote:

 Which means, for one thing, that there are thousands of files ripped by thousands of people out there with the same exact headers, and all those files will play with the channels reversed.

 

 

 

Yes, but no one uses WAV files for actual playback, so you're probably the first to notice.  And probably only half of them would on average be reversed, since the number of samples lost at the beginning is random, half of people would get an even number lost and thus not flip the channels.  

 

 

xcvbnm wrote:
    Now, I'd like to address the contention that the headers are not widely supported, and Sandisk firmware does not expect them. Let's take a very, very old version of, say, Windows Media Player. Clearly, that old version will know nothing about these modern headers. My question is, does this mean that that old version of Windows Media Player will play the files with the channels reversed? I didn't do such testing, and I don't know the answer.


INFO chunks in WAV files are much older then WMP, so I suspect all versions will support it.  The problem with them is that they're just not very widely supported, so they're not a great idea to use.  If you need to tag files, you should be using FLAC, which has much more widely supported file tags.
 xcvbnm wrote:
However, if the answer is no, you'll have to admit that this is a Sansa firmware bug after all.
As I said above, this is a bug in the Sandisk firmware.