AudioMixer | platform audio mixer , supports Android | Video Utils library
kandi X-RAY | AudioMixer Summary
kandi X-RAY | AudioMixer Summary
A cross-platform audio mixer, supports Android, iOS, macOS and Windows. Powered by WebRTC, FFmpeg and Djinni.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of AudioMixer
AudioMixer Key Features
AudioMixer Examples and Code Snippets
Community Discussions
Trending Discussions on AudioMixer
QUESTION
Line number 53 in the else :
...ANSWER
Answered 2021-Jul-19 at 01:39You can check if the menu object cached already exist open the menu object, if not load the menu scene. Simple as that.
QUESTION
I'm very new to sound. I've never explored this area in my whole life.
I thought decibels was a measure starting at 0.
But in Unity, it starts at -80db
and and "0db
" it seems it's the "100%" level volume.
Moreover, when I change the sound to -40db
it's not "half-way" between -80db
and and 0
it seems it's much closer to -80db
. So the user hears nothing when it's "half-way":
I couldn't find anywhere how to setup sound properly, and how to make the user choose "properly" the sound (= good scale).
Any idea / Unity valuable sample for this?
...ANSWER
Answered 2021-Jun-23 at 18:06From Wikipedia -> Decibel
dB is a relative unit of measurement [...] It expresses the ratio of two values
This is very common for Audio Mixers and Amps that 0
means 100% of the configured Pre-Gain
(-> in this case the input volume of your individual AudioSources).
Why? -> The given dB
are just the additional "multiplicator" (as said it is a logarithmic ratio between two values).
Usually as an Audio manager you first configure all Pre-Gains
in a way that basically everything has more or less the same absolute volume if all mixer sliders are at 0
.
Then you start to actually mix them according to your needs and only move certain volumes up or down to increase or decrease the volume by a certain factor. (Except for fading it is usually pretty uncommon to actually pull a slider down to the minimum - usually you rather Mute
the channel)
0dB
just means1:1
=> Don't change.- e.g.
6dB
means about2:1
=> twice as loud as the input volume - e.g.
-6dB
means about1:2
=> half as loud as the input volume - e.g.
20dB
means about10:1
=> Ten times as loud as the input volume - e.g.
-80dB
means1:10000
=> So0.0001
of the input volume
So the -80
is chosen a little bit arbitrary .. it could as well be -60
(=>factor of 0.001
) or -100
(=> factor of 0.00001
). "It doesn't really matter!". At a certain point the volume is simply so low that you won't hear it anymore depending on what the default maximum output of your Amp is and how precise you need the output to be.
You can e.g. use this dB calculator to check what dB
value results in what actual factor.
For a better explanation of the dB
measure itself see also e.g. these posts and What's the minimum decibel value?
QUESTION
So I am trying to make a drum machine with gstreamer. For those who are not familiar with a drum machine have a look at:
https://www.youtube.com/watch?v=KC7UaUD5rEA
Basically you have a specific sample loaded to a track. Each track has 16 steps which you can enable or disable. When you press play the drum machine will loop over the steps and when a step is enabled it will play that sound.
I got it working with the current setup: 8 x (filesrc | wavparse | audioconvert | volume) | audiomixer | alsasink
I put the pipeline in play state and each step I perform a seek_simple back to the start of the pipeline. To trigger the sound I mute and demute the wav each step according to the wanted rhythm/pattern.
The issue: By performing the seek back to the start the tail of the wav sample/sound is cut off and this makes a choppy sound. Ideally I'd like to re-trigger a wav sample but the previous one should continue to play until done.
The question: How can I re trigger a sound without cutting of it's tail?
Ps: I've tried to play with the seek flags "flush", "keep_unit", ... but without success.
My loop:
...ANSWER
Answered 2021-May-19 at 07:44I managed to achieve my goal by using this C library: https://soundprogramming.net/programming/tutorial-using-sdl2-and-sdl_mixer-to-play-samples/
This example gives a way to play multiple sound simultaneously. I then made a python wrapper around it and push a wav file to it. Follow this tutorial:
https://docs.python.org/3/extending/index.html
Feel free to post the gstreamer solution.
thx
QUESTION
I'm really new to using Unity and C#, I'll do my best to explain the situation and show relevant code.
So basically I am creating a Settings Menu in my game. Options I have are a fullscreen toggle, resolution dropdown, graphics dropdown and volume slider. All of these settings will maintain the selection on a scene change or the game being shutdown and run again, other than the volume slider.
In Unity, the volume slider will maintain it's selection. Just not in the game once it has been built. It will instead default back to middle of the slider.
Here is relevant code.
...ANSWER
Answered 2021-Feb-24 at 02:53You are close, use PlayerPrefs
to store the last value that was set.
Something like this:
QUESTION
I am new to C# and Unity and I tried to implement a volume slider. I can now adjust the volume, but the volume resets every time I try to load a new scene.
Could someone tell me how to transfer the volume to other scenes? I am using Unity 2018.3.14f1 and the code I am using for the volume is:
...ANSWER
Answered 2021-Jan-31 at 16:45Save It in PlayerPrefs
, Then load it on Start or anywhere you need it.
QUESTION
Is possible to change a object [SerializeField] for another with script? I try but doesn't work good i need to change the music with controlled with slider in the scene. The script to controller:
...ANSWER
Answered 2021-Jan-21 at 19:12Your problem has nothing to do with SerializeField. Are you aware what SerializeField do? SerializeField in Unity used for reflecting object value to Unity Editor Inspector. It doesn't affect variable protection level. When you didn't assign any protection accessors (private, public, internal), it is private as default. So only accesible in this class level. If you want to access it from another class, you should just add public accessor.
QUESTION
As in my other question I'm using one audio mixer with two groups for the game scene and the main menu scene.
In the main menu scene I have audio source for the music and audio source for the sfx effects. When the game start in the main menu the music is playing automatic on the awake.,
The sfx is not playing and I want that when I change the sfx slider it will sound the sfx effect for a short time so each time I change the slider value it will play the sfx to hear the volume of it.
The sliders as they look like in the game :
The settings script when I set also the audio volumes :
...ANSWER
Answered 2021-Jan-16 at 16:42You could do it like e.g.
QUESTION
I have audioMixerGroup.audioMixer.GetFloat("AllVolume", out tmp);
tmp will have volume in db. I vant to convert db (-80, 0) to slider's value (0, 1).
in short, I need to do How to set a Mixer's volume to a slider's volume in Unity? just the other way around
...ANSWER
Answered 2020-Dec-22 at 16:51You can create a Remap
function:
QUESTION
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.UI;
using TMPro;
using System;
public class Settings : MonoBehaviour
{
public AudioMixer audioMixer;
public TMP_Dropdown resolutionDropdown;
public Text musicText;
public Text sfxText;
public Slider[] audioSliders;
private Resolution[] resolutions;
private void Start()
{
resolutions = Screen.resolutions;
resolutionDropdown.ClearOptions();
List options = new List();
int currentResolutionIndex = 0;
for(int i = 0; i < resolutions.Length; i++)
{
string option = resolutions[i].width + " x " + resolutions[i].height;
options.Add(option);
if(resolutions[i].width == Screen.currentResolution.width &&
resolutions[i].height == Screen.currentResolution.height)
{
currentResolutionIndex = i;
}
}
resolutionDropdown.AddOptions(options);
resolutionDropdown.value = currentResolutionIndex;
resolutionDropdown.RefreshShownValue();
float musicvolume = PlayerPrefs.GetFloat("musicvolume");
float sfxvolume = PlayerPrefs.GetFloat("sfxvolume");
musicText.text = musicvolume.ToString();
sfxText.text = sfxvolume.ToString();
audioSliders[0].value = musicvolume;
audioSliders[1].value = sfxvolume;
}
public void SetResolution(int resolutionIndex)
{
Resolution resolution = resolutions[resolutionIndex];
Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
}
public void SetMusicVolume(float volume)
{
audioMixer.SetFloat("musicvol", Mathf.Log10(volume) * 20);
musicText.text = Math.Round(volume * 100, MidpointRounding.AwayFromZero).ToString();
PlayerPrefs.SetFloat("musicvolume", (float)Math.Round(volume * 100, MidpointRounding.AwayFromZero));
}
public void SetSfxVolume(float volume)
{
audioMixer.SetFloat("sfxvol", Mathf.Log10(volume) * 20);
sfxText.text = Math.Round(volume * 100, MidpointRounding.AwayFromZero).ToString();
PlayerPrefs.SetFloat("sfxvolume", (float)Math.Round(volume * 100, MidpointRounding.AwayFromZero));
}
public void SetQuality(int qualityIndex)
{
QualitySettings.SetQualityLevel(qualityIndex);
}
public void SetFullscreen(bool isFullscreen)
{
Screen.fullScreen = isFullscreen;
}
}
...ANSWER
Answered 2020-Aug-29 at 19:03I'm seeing now that when you store the value you do
QUESTION
So when I tried to build my unity project the options menu did not build correctly. I tried two unity version, a hard restart of my system, and changing settings. Nothing corrected the issue. The game works fine in the unity editor but does not work correctly when built.
Editor drop-down (How it should be):
Build drop-down (How it should not be):
If you look in the build picture it duplicates all the drop-down entries which may be cause by the script that generates it:
...ANSWER
Answered 2020-Aug-28 at 11:56For duplicates, it's a known problem: the problem is on standalone where it appears to duplicate each resolution with refresh rates of 60Hz and 48Hz.
For example: 640x480@48Hz; 640x480@60Hz; etc
A solution could be a Linq statement, selecting only 60Hz frequencies (or 48Hz):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install AudioMixer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page