It is currently Fri Jun 22, 2018 12:58 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Resampling problem (Audio plays too slow)
PostPosted: Sat Feb 03, 2018 11:21 pm 
Offline
User
User
User avatar

Joined: Wed Jan 09, 2008 10:43 pm
Posts: 16
Location: Germany
Hello,

how can I manage to get Pure-Basic to play an audio file in the correct speed, if the sample rate of the audio file doesn't match the one used in the settings of the sound card?

Here is a snipped:
Code:
initSound()
LoadSound(0, "audio.wav")
PlaySound(0)
Debug GetSoundFrequency(0)
Delay(5000)


Specs of audio.wav:
- 16-bit signed integer
- PCM
- 48000 Hz
- Stereo

My sound card is system-widely set to 44100 Hz (the sample rate setting in PulseAudio). Everything else that has to do with audio, works great on my computer.

If I run the snipped, the file plays way too slow (actually at 44100 Hz instead of 48000 Hz). There is no real-time resampling. Instead of resampling, the file is just slowed don to 44100 Hz.

The audio file plays fine in all other players installed on the same system.

How do I play it at the correct speed?

I tried SetSoundFrequency(0,48000) but it did nothing?

The opposite method, GetSoundFrequency(), delivers -17536 (a negative value :? So it should play backwards... that is nonsence value :shock: :mrgreen: )

Appendix: I'm on Linux Mint 18.1 (x64)


Top
 Profile  
Reply with quote  
 Post subject: Re: Resampling problem (Audio plays too slow)
PostPosted: Sun Feb 11, 2018 9:07 pm 
Offline
User
User
User avatar

Joined: Wed Jan 09, 2008 10:43 pm
Posts: 16
Location: Germany
It's been dealt with.

I made a replacement using SDL and that is working fine. :mrgreen:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye