IrrKlang engine sound...

Skip to first unread message

Marcel Offermans

Jun 21, 2022, 2:55:35 PM6/21/22
to ProjectChrono
When I enabled IrrKlang (and added vis->EnableSound(true) to the demos) to play (simple) engine sounds, I discovered that the engine sounded really strange. After some investigation the problem is simple:

The sound file that is played is not a nice loop with a monotone pitch!

If you change EnableSound() to:

m_sound_engine->play2D(GetChronoDataFile("vehicle/sounds/carsound_old.ogg").c_str(), true, false, true);

This is solved (so carsound.ogg is wrong, carsound_old.ogg works).

Greetings, Marcel

Radu Serban

Jun 22, 2022, 8:16:50 AM6/22/22
to ProjectChrono

Hi Marcel,


Yet another Chrono::Vehicle feature that was implemented mostly like a proof-of-concept.  I have personally not enabled this in many years…

Thanks for looking into this.  I’ll test this myself at some point and will fix the sound files (by the way, I think better and more varied ones would be needed anyway).



You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Marcel Offermans

Jun 22, 2022, 11:25:21 AM6/22/22
to ProjectChrono
For sure typically car sounds end up a lot more complicated, where engine sounds are typically done by looping and mixing samples for different RPM ranges (as you can't just change the frequency of a sample too much without it starting to sound weird), and where you then also start mixing on and off throttle samples (an engine under load sounds a lot different from one that is idling). And that is just the engine. For driving, it would also be great to hear the tyres, especially as they are operating closer to the limit of grip, as these sound cues can really help you drive the car better.

Anyway, for now it would be nice to at least have something that works out of the box, so just fixing that one sample would be a good starting point, and anything beyond that is a nice bonus! :)

Greetings, Marcel


Jun 22, 2022, 3:48:37 PM6/22/22
to ProjectChrono

The current ongoing NSF human-in-the-loop project is using an implementation of the IrrKlang sound engine. We have noticed an asymmetrical sound loop problem when trying to implement the sound effect. We ended up editing the sound file (which is a specific engine sound file used for the project) - flipping it and connecting two mirrored sounds files (if you consider the original sound 'AB', mirror it to be 'BA', then connect two files to be 'ABBA'. This ensures a symmetric loop).

Also, we have implemented a sound engine that changes the playback speed based on the RPM of the engine. This can be achieved by function - setPlaybackSpeed((irrklang::ik_f32)soundspeed);

Here is a video demo showing a highway driving scenario, please turn up the volume. You should be able to hear the engine sound changes pitch as playback speed changes with the RPM.


Freya the Goddess

Jun 23, 2022, 3:45:46 AM6/23/22
to ProjectChrono
Watched the video. Awesome simulation.

С наилучшими пожеланиями, Богиня Фрейя
Atenciosamente, Freya the Goddess
Meilleurs voeuxFreya the Goddess
Liebe Grüße, Freya the Goddess
Best wishes, Freya the Goddess
よろしくお願いします、Freya the Goddess
最好的祝福,Freya the Goddess
Matakwa mema, Freya the Goddess
مع أطيب التمنيات ، فريا الإلهة
Reply all
Reply to author
0 new messages