Sound events

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
stefino_cz
Transport Coordinator
Transport Coordinator
Posts: 268
Joined: 02 Jul 2015 08:05
Location: Czech Republic
Contact:

Sound events

Post by stefino_cz »

Hi all. I'm trying to make sound events for vehicles but I have a problem with length of sound tracks. Start sound is OK but in running vehicle and stopped vehicle there are periodic sound mistakes. Somethink like if two sound tracks are merged into one. I use SOUND_EVENT_RUNNING_16 - Every 16 engine ticks if in motion. I thought that if one tick is 30ms, so 16 ticks is 0,48s = track has length 0,48s. But no...it gives huge sound bugs.

How to make track what will sound correctly? It needs special length or what? Thanks a lot :)
Image
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Sound events

Post by Gwyd »

Perhaps try making it a tick (30ms) longer or shorter, maybe 2. It may be that openttd has a slight delay.
User avatar
stefino_cz
Transport Coordinator
Transport Coordinator
Posts: 268
Joined: 02 Jul 2015 08:05
Location: Czech Republic
Contact:

Re: Sound events

Post by stefino_cz »

Yes but the problem is in period too. It seems that it is not constant :? This topic what was sent to me by frosh wrote about it. I tried length 0,53s and it gives a no-sound breaks. 0,54s gives "merged sound" mistakes.
https://bugs.openttd.org/task/5473
Image
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Sound events

Post by Gwyd »

What does SOUND_EVENT_RUNNING do? It says no more than once per tick, but once every movement. I think one of two things may happen: 1 it'll wait until the sound ends before playing again. 2 it'll repeat over different periods depending on how fast the vehicle is going.
User avatar
stefino_cz
Transport Coordinator
Transport Coordinator
Posts: 268
Joined: 02 Jul 2015 08:05
Location: Czech Republic
Contact:

Re: Sound events

Post by stefino_cz »

Gwyd wrote:What does SOUND_EVENT_RUNNING do? It says no more than once per tick, but once every movement. I think one of two things may happen: 1 it'll wait until the sound ends before playing again. 2 it'll repeat over different periods depending on how fast the vehicle is going.
I tried it too and it seems like 2nd possibility
Image
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 13 guests