INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Audio sample rate problem  (Read 1221 times)

aliciaviola

  • Galactic Citizen
  • ****
  • Posts: 393
Audio sample rate problem
« on: April 07, 2022, 03:17:14 am »

If I am using Mediacenter (newest build/ Macbook Pro 2021 M1 Pro/ OS 12.3.1) together with an audio editor like WaveLab Pro oder iZotope RX 9 and play a file with a sample rate of 44 kHz and then a different file in MC with 48 kHz the file in MC sounds a halftone flat. With 96 kHz it sounds like slow-motion.
Is there any possibility to use them without this effect. I often use them simultaneously to compare the pitch of recordings or to make tracks in WaveLab.
Frank
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Audio sample rate problem
« Reply #1 on: April 07, 2022, 09:55:18 am »

If I am using Mediacenter (newest build/ Macbook Pro 2021 M1 Pro/ OS 12.3.1) together with an audio editor like WaveLab Pro oder iZotope RX 9 and play a file with a sample rate of 44 kHz and then a different file in MC with 48 kHz the file in MC sounds a halftone flat. With 96 kHz it sounds like slow-motion.
Is there any possibility to use them without this effect. I often use them simultaneously to compare the pitch of recordings or to make tracks in WaveLab.
Frank
Are you enabling exclusive access in MC's audio settings?

You can get detailed information about the audio device opening in MC by turning on logging.
If you do that and capture a log, post it here.
Logged

aliciaviola

  • Galactic Citizen
  • ****
  • Posts: 393
Re: Audio sample rate problem
« Reply #2 on: April 07, 2022, 04:28:31 pm »

Exclusive access is the option to listen to music in the best possible way and I often use it.
But when I want to work with other sound programs, also, it's impossible to choose this option
because I couldn't work with WaveLab or iZotope in an acceptable way.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Audio sample rate problem
« Reply #3 on: April 07, 2022, 04:58:51 pm »

Exclusive access is the option to listen to music in the best possible way and I often use it.
But when I want to work with other sound programs, also, it's impossible to choose this option
because I couldn't work with WaveLab or iZotope in an acceptable way.
It seems like somehow your other programs are changing the sample rate for the device. I'm not sure how this can be but if you pull a log when you duplicate the issue and post it here we can take a look at and see if something can be done.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Audio sample rate problem
« Reply #4 on: April 08, 2022, 06:08:23 am »

This has been happening to me for many years.  It usually happens when I play a YouTube video and YouTube/MacOS sets my audio device to 48kHz.  When I then use MC to play a 44.1kHz file, it sounds way slow and low pitched, because it's being played at 48kHz, instead of 44.1.

Generally, the "fix" for me is to press STOP on MC, which seems to reset things.  I generally never use the stop key.  Instead I use the Play/Pause key.  I see no reason to use stop.  I think this is why MC is not setting the sample rate.  MC thinks it set the sample rate at the beginning of the song, so it doesn't bother to reset it when I "unpause" a paused track.  But this track has been paused for minutes, hours, or days, and another program has reset the sample rate while MC was paused.

I guess one possible fix would be to reset the sample rate on every unpause event.

Brian.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Audio sample rate problem
« Reply #5 on: April 08, 2022, 08:59:00 am »

This has been happening to me for many years.  It usually happens when I play a YouTube video and YouTube/MacOS sets my audio device to 48kHz.  When I then use MC to play a 44.1kHz file, it sounds way slow and low pitched, because it's being played at 48kHz, instead of 44.1.

Generally, the "fix" for me is to press STOP on MC, which seems to reset things.  I generally never use the stop key.  Instead I use the Play/Pause key.  I see no reason to use stop.  I think this is why MC is not setting the sample rate.  MC thinks it set the sample rate at the beginning of the song, so it doesn't bother to reset it when I "unpause" a paused track.  But this track has been paused for minutes, hours, or days, and another program has reset the sample rate while MC was paused.

I guess one possible fix would be to reset the sample rate on every unpause event.

Brian.
That makes sense now. Hitting the pause button doesn't close the device. Keeping the device open across tracks etc (gapless) is what makes it possible to avoid clicks, pops etc when stopping and starting.
We don't SET the sample rate, we CHOOSE to open a stream using a handle that Apple gives us with a correct sample rate.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Audio sample rate problem
« Reply #6 on: April 08, 2022, 10:09:51 am »

This has been happening to me for many years.  It usually happens when I play a YouTube video and YouTube/MacOS sets my audio device to 48kHz.  When I then use MC to play a 44.1kHz file, it sounds way slow and low pitched, because it's being played at 48kHz, instead of 44.1.

Generally, the "fix" for me is to press STOP on MC, which seems to reset things.  I generally never use the stop key.  Instead I use the Play/Pause key.  I see no reason to use stop.  I think this is why MC is not setting the sample rate.  MC thinks it set the sample rate at the beginning of the song, so it doesn't bother to reset it when I "unpause" a paused track.  But this track has been paused for minutes, hours, or days, and another program has reset the sample rate while MC was paused.

I guess one possible fix would be to reset the sample rate on every unpause event.

Brian.
Interesting, I'm completely unable to get this to happen on my Macbook pro running Catalina using the default core audio output device.
I start MC, play a 44.1k track, pause, go to another app, VLC, safari, etc, play a video with a 48k track. Unpause MC. Everything is good.

My MC is set to float output (no integer mode, no exclusive access).

Also, the midi panel doesn't show that the sample rate on the built in speakers has changed at all when I'm playing the 48k material.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Audio sample rate problem
« Reply #7 on: April 08, 2022, 11:00:40 am »

When I put an external DAC on with a sample rate light, I play a track in MC, pause, play a track in YouTube, pause, play the track in MC again with a much higher sample rate, pause, unPause in YouTube and the Youtube plays fine and the sample rate doesn't change which means it's adapting to the sample rate MC set.

I'll add a reset of the sample rate on unpause, only when in non-exclusive and non-integer mode because integer mode is set differently and log it. We'll see what we get.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Audio sample rate problem
« Reply #8 on: April 09, 2022, 07:35:07 am »

I just did some experiments of my own and I can't duplicate what I have reported.  But my report is based on several years of experience.  I'm really quite certain this has happened to me at least a dozen times. 

My guess is that there is a timing element here.  Like for example if I left MC paused for a few hours, things might be different.  I can't be sure of that and frankly I'm not going to test it as it would take too long.

But THANK YOU for adding the additional code to try to fix this unusual behavior.  We appreciate it!  :)

Brian.
Logged

aliciaviola

  • Galactic Citizen
  • ****
  • Posts: 393
Re: Audio sample rate problem
« Reply #9 on: April 10, 2022, 04:56:05 pm »

This only happens with programs like WaveLab or iZotope, not with Apple Music or music played over Safari, Chrome or the finder.
29.0.30 seems to fix the problem that exists for many years now (like that with special characters that up to now has not been solved).
Logged

aliciaviola

  • Galactic Citizen
  • ****
  • Posts: 393
Re: Audio sample rate problem
« Reply #10 on: April 12, 2022, 06:10:49 am »

Again many thanks for the solution. Now the switch between the programs works without a problem.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Audio sample rate problem
« Reply #11 on: April 12, 2022, 08:29:49 am »

Again many thanks for the solution. Now the switch between the programs works without a problem.
Thanks for the feedback.
Logged
Pages: [1]   Go Up