Jump to content

How to play an ogg file, but only make it audible on a specific freq?


Recommended Posts

Posted

Hopefully someone can help me (perhaps this is simple and my ME skills just need refreshment 🙂)

 

What would be the easiest way* to play an audio (ogg) file once, and only have players hear it if they've tuned to the correct frequency?

 

In anticipation for its EA release, I'm creating a mission for the Mudhen and, as DCS ATC is kinda.... well.. I don't need to explain... I did my own ATC audio with help of TTS. In my mission, the player(s) will be no.3 in a flight of 4 and I let the AI flight lead do most of the communications. So how do I manage to "play" the sound files when needed, despite if the player tuned to the correct freq or not, but only have the player hear the sound file if he/she tuned to the correct freq?

 

 

*The only way I can think of at the moment, actually requires a lot of trigger actions (especially if you want the player to get a heads up that he/she is not on the correct freq).

  • Like 1

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

Cockpit parameter equal to would be the one.  IF they’re included with the F-15E. 
 

Example Viper UHF is COMM1_FREQ.  We don’t know what they’ll be called with the Strike Eagle, but it might be like the Harrier which is COMM1_FREQ or COMM2_FREQ.  
 

As for how, you could do a switched condition with that so maybe set a flag true when tuned correctly.  If the flag is false, then have a prompt to the player.
 

This also really only works single player.  It MAY work multiplayer hosted locally, but we’ll just have to see what happens.  
 

 

 

  • Like 1
Posted (edited)
3 hours ago, Sedlo said:

Cockpit parameter equal to would be the one.  IF they’re included with the F-15E. 
 

Example Viper UHF is COMM1_FREQ.  We don’t know what they’ll be called with the Strike Eagle, but it might be like the Harrier which is COMM1_FREQ or COMM2_FREQ.  
 

As for how, you could do a switched condition with that so maybe set a flag true when tuned correctly.  If the flag is false, then have a prompt to the player.
 

This also really only works single player.  It MAY work multiplayer hosted locally, but we’ll just have to see what happens.  
 

Yeah that's how I did it on my previous missions, but the problem is; this way, the sound file is played right at the moment when the player tunes to that freq (even if that happens far too late).

 

For instance:

A sound file should be played when player is still on the ground and tuned to a certain freq. Player fails to tune to that freq and takes off. Then later, in mid air, he remembers and tunes to that freq, the sound file triggers are met and the sound file will play then (too late).

 

It'll require quite a few trigger conditions to prevent the above from happening, so I kinda hoped there was an easier way to have a sound file played only once on one specific freq.

 

An option like: "Play sound file ... once on freq ..."

Edited by sirrah
  • Like 1

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

Ah, I gotcha.   
 

Well, I guess you’d have to put in another condition in thr trigger. When the player takes off have flag “TakeOff” set to on. 
 

Then for the previous trigger, have a condition saying “TakeOff” = false in order for it to fire.  
 


 

  • Like 1
Posted
2 hours ago, Sedlo said:

Ah, I gotcha.   
 

Well, I guess you’d have to put in another condition in thr trigger. When the player takes off have flag “TakeOff” set to on. 
 

Then for the previous trigger, have a condition saying “TakeOff” = false in order for it to fire.  
 


 

Yes indeed. Not impossible or difficult, but it soon becomes a lot of conditions and possibly even several trigger lines, to achieve something so "simple" 😅
I was just hoping there was an easier way that I might have overlooked.

Thank you for your feedback!

  • Like 2

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted
7 hours ago, sirrah said:

A sound file should be played when player is still on the ground and tuned to a certain freq. Player fails to tune to that freq and takes off. Then later, in mid air, he remembers and tunes to that freq, the sound file triggers are met and the sound file will play then (too late)

Maybe a slightly different approach can help:

1. have a menu item in communications-->other "Send xxxx request"

players are expected to have tuned to the correct freq when they are ready, and only to send the request when ready

The menu item sets a flag that activates a formerly inactive unit that then starts to transmit the message on the indicated frequency

Now, above approach is fraught with potential issues: no guarantee that player is tuned in correctly, no easy repeats (unless you resort to scripting), not multiplayer friendly. But maybe a workable stop-gap. The upside is that since you are responding to an exact flag event, you can easily accompany the  transmission with a text transcript. 

  • Like 2
Posted
1 hour ago, cfrag said:

Maybe a slightly different approach can help:

1. have a menu item in communications-->other "Send xxxx request"

players are expected to have tuned to the correct freq when they are ready, and only to send the request when ready

The menu item sets a flag that activates a formerly inactive unit that then starts to transmit the message on the indicated frequency

Now, above approach is fraught with potential issues: no guarantee that player is tuned in correctly, no easy repeats (unless you resort to scripting), not multiplayer friendly. But maybe a workable stop-gap. The upside is that since you are responding to an exact flag event, you can easily accompany the  transmission with a text transcript. 

Tnx cfrag

The "have a unit transmit on the indicated freq" crossed my mind too (although I have no experience yet in using that).

If I'm not mistaking, this is what many mission makers often use to transmit background chatter, right? But won't this cause the unit to continuously repeat that sound file, or can I also make a unit transmit a sound file only once? (As mentioned above, I'll have to figure out how it works exactly 🙂)

 

As you said, activating that particular unit when my trigger condition is met, would be a great solution. But if that unit then automatically keeps repeating that sound file, it would kinda loose its goal (or I'll have to deactivate it exactly the same time the sound file finishes, which will be quite a hassle 😅)

  • Like 1

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted
6 minutes ago, sirrah said:

But won't this cause the unit to continuously repeat that sound file, or can I also make a unit transmit a sound file only once?

My somewhat naïve interpretation of the LOOP command is that, unless checked, the file is played only once

image.png

Put otherwise: I really don't know, but might be worth a shot 🙂

 

  • Like 1
Posted

Cool! That seems to be a very good option then!

Tnx again to you both. Hopefully the missus grants me some DCS time this evening, so I can try this out.

  • Like 1

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted (edited)

Just getting back here to say: this works!

By using ground units and set them to the desired freq, I can now transmit a sound file on that freq, despite if the player tuned to it or not. That was exactly what I was looking for!

 

One thing though, maybe someone here knows, is it correct that you can not set a unit to a freq with decimals?

When I set the unit to 264 MHz, I can hear the sound file when it plays

When I set the unit to 264.700 MHz, I can't hear it

Am I doing something wrong, or is it just not possible to use decimal freq's?

null

image.png

Edited by sirrah

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted
7 minutes ago, Sedlo said:

Decimals work with no issues, in most cases.  I'm thinking it might be something to do with the player not correctly tuned?

 

Really?

I switched to the Hornet and I'm very sure I know how to tune to a freq in there 😅. To prove it, it does work when I leave out the .700 😉

 

I did notice though, that when I set the freq to 264.700 (as shown in my screenshot), the 00's are removed after I enter. Leaving the frequency 264.7

Perhaps that causes an issue?

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

Are you using cockpit parameters as part of your trigger?  There are some frequencies, for reasons I don't know why, the parameters are all screwed up when tuning via preset.  Usually when there's more than one digit to the right of the decimal.  In that case, cockpit parameter in range is the answer.  Do 264.69-264.71 and if that works, that's what is going on.

Yep, just checked, that's one of the frequencies that gets all f'd up.

264.7 returns as 264.700016 when tuned via preset for reasons I have no idea.

Type it in manually and 264.7 returns 264.7.  I've made several bug reports on this to ED for years with no solution.  

Wasn't meaning to say you weren't tuning your radio correctly.  More that the player aircraft reports the paramater tuned to a different frequency than is selected.

Posted (edited)
2 hours ago, Sedlo said:

Are you using cockpit parameters as part of your trigger?  There are some frequencies, for reasons I don't know why, the parameters are all screwed up when tuning via preset.  Usually when there's more than one digit to the right of the decimal.  In that case, cockpit parameter in range is the answer.  Do 264.69-264.71 and if that works, that's what is going on.

Yep, just checked, that's one of the frequencies that gets all f'd up.

264.7 returns as 264.700016 when tuned via preset for reasons I have no idea.

Type it in manually and 264.7 returns 264.7.  I've made several bug reports on this to ED for years with no solution.  

Wasn't meaning to say you weren't tuning your radio correctly.  More that the player aircraft reports the paramater tuned to a different frequency than is selected.

Ah ok, I'll create a bug report for it (just fwiw)

 

I'm not using the cockpit parameter for this mission (player just doesn't hear the calls if not tuned correctly, like he/she wouldn't irl 😉)

 

Guess I'll use a non decimal freq then to solve it (it's just that in real life Incirlic twr is on 264.7 if I'm not mistaking)

Edited by sirrah
  • Like 1

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted
On 4/27/2023 at 7:29 PM, Sedlo said:

Are you using cockpit parameters as part of your trigger?  There are some frequencies, for reasons I don't know why, the parameters are all screwed up when tuning via preset.  Usually when there's more than one digit to the right of the decimal.  In that case, cockpit parameter in range is the answer.  Do 264.69-264.71 and if that works, that's what is going on.

Yep, just checked, that's one of the frequencies that gets all f'd up.

264.7 returns as 264.700016 when tuned via preset for reasons I have no idea.

Type it in manually and 264.7 returns 264.7.  I've made several bug reports on this to ED for years with no solution.  

Wasn't meaning to say you weren't tuning your radio correctly.  More that the player aircraft reports the paramater tuned to a different frequency than is selected.

Couldn't let it go, so I made two simple missions, to test this. (one for Caucasus and one for Syria, to rule out map related issues)

 

F/A-18C hot start on ramp with COM1 set to 264.7 and COM2 set to 264

Placed two ground units and have them transmit/play a sound file. One on 264.7 (triggered after 15secs) and one on 264 (triggered after 20secs)

 

Strangely enough, on both my test missions, I was able hear both sound files... 

So, that got me thinking... why on earth does it work now and not on the mission I was working on in my OP?!

Then I remembered, for these test missions, I placed new units. In my previous mission, I copy/pasted the transmitting unit. And that's where things appear to go sideways.

 

So, yes, transmitting a sound file from a ground unit does work (also for decimal frequencies), but do not copy paste that unit when you want to create a new transmitting ground unit. Add a new unit by clicking the ground unit icon on the left of the screen.

  • Like 1

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

Ah, very good!  Glad that’s sorted!

One other thing, if you decide to use the same unit for multiple transmissions, don’t use the clone tool in the triggered actions    That can mess things up , too  

 

(Like, don’t clone the transmission, then change the audio file name. Messes everything up).  

 

 

  • Thanks 1
Posted
5 minutes ago, Sedlo said:

Ah, very good!  Glad that’s sorted!

One other thing, if you decide to use the same unit for multiple transmissions, don’t use the clone tool in the triggered actions    That can mess things up , too  

 

(Like, don’t clone the transmission, then change the audio file name. Messes everything up).  

 

 

Ahh thanks, good to know!

I would have used that indeed. This saves me more troubleshooting 😉 

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...