Sound file triggering question!
Hello! This isn't for a game, but it would be a very similar issue. I'm trying to use my car's RPM to play through an mp3 file. It's basically just for fun to see what can be done as far as tweaking my exhaust sound a tiny bit.
The idea behind it is that if I speed up, the mp3 plays through until I shift, and then it restarts. If I slow down, it should play more slowly in reverse direction.
I originally wrote a proof of concept in Python, but it didn't run fast enough from my Raspberry Pi 3 B+, so I'm switching it to C++. I really just don't know if any game development guys might have done something similar for a car-based game. Thanks!
About this post
- Posted
- Archived
- Score
- 3 · 100% up
- Kind
- Text
- ID
- b53us5
5 comments
Adjust the pitch, a low pitch for low rpm and vice versa. Also adjust the speeds accordingly.
That’s the right idea, but I don’t know a C++ library that could do that.
Look into fmod I think it's called. I got some audio working with that. If you're good with Python it should only be a matter of learning the C++ syntax.
I think fmod had options for everything. If not then I'm not sure, maybe SDL has some audio functions? You COULD do it in Unity and build it as an app for your phone.
Sounds like an interesting project, but what is the actual question you're trying to ask?
How to play through a different part of a sound file dependent on RPM.