wrong samplerate in au-files off project

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
matlo
Posts: 2
Joined: Wed May 25, 2011 7:26 am
Operating System: Please select

wrong samplerate in au-files off project

Post by matlo » Wed May 25, 2011 7:59 am

Hi,

I recorded on Ubuntu (10.10) but my File-System (Fat32 on SD-Chip) was Defect.

After chdisk i get some lost&found-files. I show this files with HEX-Editor.
In des snd-header ar the wrong sample rate (44100). I take 48000 by recording.

It`s a BUG?

It is posible to read useful infos from snd-header for reparing the project-data?

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: wrong samplerate in au-files off project

Post by steve » Wed May 25, 2011 5:11 pm

Audacity data files (.AU) do not have a specified sample rate. The sample rate is set by the AUP file, so I don't know what files you are analysing, but if they say what the sample rate is in the header, then they are not Audacity data files. If you "Import" existing audio files into Audacity then they may have a different sample rate.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

billw58
Forum Staff
Posts: 5601
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: wrong samplerate in au-files off project

Post by billw58 » Wed May 25, 2011 7:49 pm

steve wrote:Audacity data files (.AU) do not have a specified sample rate
Hmmmm .... what's this then (from SimpleBlockFile.h)

Code: Select all

// The AU formats we care about
enum {
   AU_SAMPLE_FORMAT_16 = 3,
   AU_SAMPLE_FORMAT_24 = 4,
   AU_SAMPLE_FORMAT_FLOAT = 6,
};

typedef struct {
   wxUint32 magic;      // magic number
   wxUint32 dataOffset; // byte offset to start of audio data
   wxUint32 dataSize;   // data length, in bytes (optional)
   wxUint32 encoding;   // data encoding enumeration
   wxUint32 sampleRate; // samples per second
   wxUint32 channels;   // number of interleaved channels
} auHeader;
Comparing this to the top of a .au file:
magic 2E 73 6E 64 (.snd)
dataOffset 00 00 60 8C
dataSize FF FF FF FF
encoding 00 00 00 03
sampleRate 00 00 AC 44 (= 44100)
channels 00 00 00 01

-- Bill

matlo
Posts: 2
Joined: Wed May 25, 2011 7:26 am
Operating System: Please select

Re: wrong samplerate in au-files off project

Post by matlo » Wed May 25, 2011 8:51 pm

Thanks billw58

For the better understanding:

My Project-Folder is corrupt. Many of the .au Files are in the Lost&Found folder but without the right name.
The Record was 1h and 600 au-files are moved.

When I drop the file in audacity I can hear it but whit the wrong speed. When I repare the file-header the speed is correct.

I think it's better when the right speed a saved and some add-data for finding the original-position are helpful too.

OK ... the best is use a better file-system.

sorry for my terrible English (I'm from ger)

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: wrong samplerate in au-files off project

Post by steve » Wed May 25, 2011 11:17 pm

billw58 wrote:Hmmmm .... what's this then (from SimpleBlockFile.h)
Curious.
I'm guessing that is a legacy hang-over as Audacity does not appear to use that information. Regardless of the recording sample rate, the block files report a sample rate of 44100, but Audacity ignores that and uses the sample rate that is stated in the AUP file.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply