High Pitch On Export

Hi. I recorded some music at 192khz (this may have been a mistake) and it sounds good when I play it in Ardour. When I export it as a wav or a flac, the playback is high pitched.

I feel like I made some mistake regarding the export settings. I have read the manual and have tried a few different export settings but it’s the same result every time – the exported file is high pitched.

What am I missing? How do I export a wav or a flac that sounds like it does in Ardour?

It sounds like a sample rate conversion issue, you are exporting at a lower sample rate than it is playing back at. A few questions for more info.

What device is being used for playback (Audio interface, etc.) and what software?

What does sndfile-info say about the exported file if you have access to that?

And what were the settings you used to export the file at in Ardour?

1 Like

Can you check what sample-rate the exported file has? On GNU/Linux easiest via

sndfile-info /path/to/your/exported_file.wav

It could also be that you may have configured Ardour/JACK to use 192kHz, but your soundcard was actually running at a different rate. So Ardour thinks a file was 192k while in fact it’s not.

If so, one way to recover is to force-change the sample-rate of the exported file, e.g.

sox -r 48000 broken_file.wav new_good_file.wav

or convert it to raw PCM and back. see also https://sound.stackexchange.com/questions/32980/wav-file-recorded-with-wrong-header

1 Like

Thanks for the reply. :slight_smile:

I’m using my Focusrite for playback, the same thing I used to record. And I played it back in VLC (mostly because that’s just the default). I assume it’s using ALSA?

IIRC I picked 48khz for the exported file, but I could be misremembering.

Anyway, here’s the sndfile-info output.

$ sndfile-info session.flac

File : session.flac
Length : 122519495
FLAC Stream Metadata
Channels : 2
Sample rate : 48000
Frames : 41269163
Bit width : 24
Vorbis Comment Metadata

Sample Rate : 48000
Frames : 41269163
Channels : 2
Format : 0x00170003
Sections : 1
Seekable : TRUE
Duration : 00:14:19.774
Signal Max : 8.38861e+06 (0.00 dB)

Is your focusrite by chance still running at 192kHz?

That would explain the issue. Try taking the file to a different device (Your phone for instance) and playing it there, see if it still sounds high pitched.

Well I just unplugged the focusrite and played the file through my laptop speakers and…

…high pitched still.

OK, so the likely issue is that you’ve created an Ardour session at 192KHz, but the actual rate is 48k [1]
So when you export, ardour downsamples and pitch increases.

One way would be to “export at session rate” you get a file that says it’s 192kHz, while in fact the content is 48k. Then force change the sample-rate in the file-header using sox.

[1] This can happen with JACK on Linux, it can silently fall back to the nearest available sample-rate or some hardware configured rate. – It could also be 96k or 44.1 …

Okay. Thanks for your reply.

I think I did try this before, to use Export At Session Rate, as this was the default setting, and I got the same high-pitched weird result. But now that I know a little more about the settings I’ll look closer and try what you say and report back…

Ah, and now that I poke at the settings again, I remember why I picked 48khz. It’s because when I select Something Else as the Compatibility option, it reds-out Session Rate. It won’t let me pick Session Rate, unless I deselect all the Compatibility options. So I’ll try that…

So I exported at Session Rate and got the same old result – high pitched.

Then I tried your sox thing and:

$ sox -r 48000 session.flac Wednesday4Sept2019.flac
sox WARN formats: can’t set sample rate 48000; using 192000
Interesting. This seems to jibe with your suggestion that the labeled sample rate was not the actual sample rate?

Anyway this is clunking away so I’ll report back if and when there’s output.

The output is still high pitched.

I feel like the solution is to just junk it and rerecord without an absurdly high sample rate.

try with the .wav (not .flac)

Okay. I exported it as a WAV, (not with Session Rate because that wasn’t an option). I listened to it. High pitched. I ran sox on it anyway. High pitched.

Something somewhere is borked and I think starting over from scratch is the correct choice at this point. And this time I will not choose such an absurd sampling rate.

While I can’t disagree that it may solve your problem quicker, it would be nice to understand what happened to cause this, as it shouldn’t be happening like this as well. I would ask if you could zip/tar/whatever the session folder, but not sure I have an interface to run 192k right now myself (I work up to 96k myself but that is it), could you at least put up the exported file somewhere I might be able to look at if I manage to get a free moment tomorrow?