You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.
Add environment variable for getting execution-engine/audio-driver/commandline-option specific value, e.g. sample-rate.
For an example of sample-rate, the audio driver is launched after the global context is evaluated because if no dsp function and @ operator are used, no need to launch the audio driver. However, the sample-rate will be typically acquired in the global context. Thus the sample-rate should be treated as a runtime-defined value somehow.
The proposed solution is as follows.
Each runtime and the audio driver must implement an interface method to register environment variables, which is called before mimium's global context is evaluated.
runtime can take optional environment variables from the constructor's argument.
environment variables will be a pair of string and float to keep the simplicity of implementation for now.
To get a specific environment variable, use special function getEnv("hoge") is used.
More extended features will be...
Introduce a syntax sugar like #SAMPLERATE instead of getEnv("SAMPLERATE").
User can specify a requirement of the environment variables. If no sample rate is specified when a file backend is used, there will be no default value. This may cause unsafe behavior such as division by zero. Sometimes it is useful that backends can provide default values but sometimes it is useful that raising an error when specified values are not present in the environment-variables table.
For example, #SAMPLERATE or getEnv("SAMPLERATE") returns zero, on the other hand, !#SAMPLERATE or getEnvRequired("SAMPLERATE") raise error if no Environment Variable "SAMPLERATE" is provided.
The text was updated successfully, but these errors were encountered:
Add environment variable for getting execution-engine/audio-driver/commandline-option specific value, e.g. sample-rate.
For an example of sample-rate, the audio driver is launched after the global context is evaluated because if no
dsp
function and@
operator are used, no need to launch the audio driver. However, the sample-rate will be typically acquired in the global context. Thus the sample-rate should be treated as a runtime-defined value somehow.The proposed solution is as follows.
getEnv("hoge")
is used.More extended features will be...
#SAMPLERATE
instead ofgetEnv("SAMPLERATE")
.For example,
#SAMPLERATE
orgetEnv("SAMPLERATE")
returns zero, on the other hand,!#SAMPLERATE
orgetEnvRequired("SAMPLERATE")
raise error if no Environment Variable "SAMPLERATE" is provided.The text was updated successfully, but these errors were encountered: