2 problems with playing custom sound

Discussion in 'Mapping Questions & Discussion' started by Mikroscopic, Nov 24, 2016.

  1. Mikroscopic

    aa Mikroscopic

    Messages:
    593
    Positive Ratings:
    599
    I am trying to play some custom music files throughout my map using an ambient_generic but I have encountered two problems

    1) The sound was too quiet, so I stacked up two ambient_generics to play the sound at once, but now the sound cuts off halfway through playing. This was not an issue when I used only one entity.

    2) I am using AddOutput on the ambient_generic to change the audio file I want to play, but it says "EmitAmbientSound: sound not precached: " in the console and does not play the sound.

    EDIT: I solved the above problem, I just put an inactive ambient_generic with the desired sound in the keyvalue.

    The sounds are 320 Kbps, 44,100 Hz, 16 Bit, Stereo, MP3. They are activated manually and are not meant to loop.
     
    Last edited: Nov 24, 2016
  2. Mikroscopic

    aa Mikroscopic

    Messages:
    593
    Positive Ratings:
    599
    Alright, now the sound cuts off even if I have only one ambient_generic. Anyone know what might be causing this?
     
  3. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,213
    Are you, perchance, trying to use a WAV file instead of an MP3? Because that was the issue (I guess) when I had a similar problem. Might have something to do with limited space in the sound cache, or a hard limit on filesize... who knows.
     
  4. Mikroscopic

    aa Mikroscopic

    Messages:
    593
    Positive Ratings:
    599
    I am using MP3 files. I'd like to note that they did play in full at one point but somehow I did something to break them.

    EDIT: The file is also 1.38 MB in size.
     
    Last edited: Nov 24, 2016
  5. Mikroscopic

    aa Mikroscopic

    Messages:
    593
    Positive Ratings:
    599
    THIS ISSUE HAS BEEN SOLVED

    Alright, so I remade the audio files at a lower quality (112 kbps, 44100 Hz) and now they seem to play. I suppose you were right about the file size issue, since these are longer audio files than usual.
     
  6. henke37

    aa henke37

    Messages:
    1,837
    Positive Ratings:
    420
    Use a soundscript. That way you get to specify the mixer channel to use and the mixer settings to use. Which just so happens to include the attenuation.
     
    • Agree Agree x 1
  7. BigfootBeto

    aa BigfootBeto Too obsessed with perfection

    Messages:
    361
    Positive Ratings:
    537
    I tried this and the sounds were still not precached. Am I missing something?

    Edit: I fixed it. Lesson of the day: Always double check your file names...
     
    • Funny Funny x 1
    Last edited: Apr 9, 2017