ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know this is not exactly forum about sound but i need some help. Do you know any good algorithm, which should change e.g. speech rate? I have recorded speech and I need something to slow ti down or fasten it up. I know that audacity can do this but i have my application and I'd like to know how to work with sound. Do you know any idea or some algorithms to work with it?
I know this is not exactly forum about sound but i need some help. Do you know any good algorithm, which should change e.g. speech rate? I have recorded speech and I need something to slow ti down or fasten it up. I know that audacity can do this but i have my application and I'd like to know how to work with sound. Do you know any idea or some algorithms to work with it?
thx.
Do you want mathematical background or do you want implementation ?
If the latter, for the whole sound system or, say, batch processing for files ?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Quote:
Originally Posted by smeezekitty
to do it the quick and dirty way:
to speed up the sample rate::duplicate samples
to slow it own::skip samples
I might be mistaken, but when you do this by adding or deleting samples, you are changing the pitch of the sound.
Imagine that you have a sine for which one period is described with 20 samples. If you play it by omitting every second sample, you play this sine in the same time, but only using 10 samples per period. 10 samples in the same time as previously held 20 samples with a constant sample rate really increases the frequency.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
No, it does not. Modern software programs are able to chnage the speed without changing the pitch. I believe that is done by changing the sampling rate, and shifting the frequency by an equal amount in the frequency domain.
Isn't the OP simply wanting to speed up or slow down the playback rate? Kind of like spinning the LP disk faster or slower on the turntable? Digitized sound is basically a time ordered series of discreet samples. Accurate playback fidelity implies using the same conversion rate for the DAC as was used for the ADC in the recording phase. Not doing so will alter the pitch. Most digital sound files contain sample rate information, which can potentially be altered, such that the playback rate will differ from the recording rate. The exact format of the file will dictate what would need to be changed, and also what changes would be seen as valid. There may be tools which make this kind of editing simple, however with knowledge of the file format, one should be able to use a generic binary-style editor.
On the other hand, the original poster may be asking how to re-sample a recorded sound file. If the sound is re-sampled with fewer samples per unit of time, it will decrease both the file size and fidelity. If the sound is re-sampled with more samples per unit of time, it will increase the file size, but will not increase fidelity. A quick Google search for 'audio resampling algorithm' turned up numerous useful hits for me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.