Change playback speed of a sound #812
-
I am wondering if there is any way to slow down or speed up an ma_audio object? Pitch I read seems to have a effect on time, but I I don't believe its the effect I am looking for. I am looking for something like, say adjusting the sample rate to a percentage of the original or something along those lines. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
It's called "resampling." It happens in audio chains when the recorded rate is different than the output rate, and it can be down-sampling or up-sampling. It might not have a great result though. There are DAW plug-ins for such things. It is difficult to do this without loss of fidelity and also without heavy CPU usage if done real-time. I suspect there may be a provision in miniaudio. I don't know enough about that. |
Beta Was this translation helpful? Give feedback.
-
Got it! I assume this is for speech then. You might look at some games to see how they accommodate this as an accessibility provision. I think some podcast players and online courses allow for this also. I haven't checked You Tube. I'm not certain any can do this without changing the pitch though. Have you considered subtitles and a way to control how long they appear (or how slowly they scroll through)? I notice a recent game has a lengthy viewer hazard warning that cannot be read fully, and I do read quickly :). |
Beta Was this translation helpful? Give feedback.
-
So changing the pitch does actually change the playback speed, but it's just a simple resampling operation under the hood. I suspect you are wanting to increase the speed, but not actually change the pitch so everyone sounds all squeaky - I guess something like YouTube playback speed settings. That is not available as stock in miniaudio. You would need to make use of the node graph and plug in your own effect node to handle this. I have no experience with this kind of thing so unfortunately I can't give you any targeted advice. |
Beta Was this translation helpful? Give feedback.
So changing the pitch does actually change the playback speed, but it's just a simple resampling operation under the hood. I suspect you are wanting to increase the speed, but not actually change the pitch so everyone sounds all squeaky - I guess something like YouTube playback speed settings. That is not available as stock in miniaudio. You would need to make use of the node graph and plug in your own effect node to handle this. I have no experience with this kind of thing so unfortunately I can't give you any targeted advice.