DTMF Class |
The DTMF type exposes the following members.
Name | Description | |
---|---|---|
DTMF | Constructs a new DTMF. | |
DTMF(Double, Double, Double) | Constructs a new DTMF using specified parameters. |
Name | Description | |
---|---|---|
BusySignal | Gets the DTMF instances representing a telephone busy signal. | |
DialTone | Gets the DTMF instance representing a telephone dial tone. | |
EmergencyBroadcastSystemAlert | Gets the DTMF instance representing the Emergency Broadcast System alert tone. | |
OffHook | Gets the DTMF instances representing a telephone off-the-hook signal. |
Name | Description | |
---|---|---|
ComputeFrequencies | Computes a dual-tone multi-frequency sound for the given DTMF information and time. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
Generate(WaveFile, DTMF, Double) | Generates the specified dual-tone multi-frequency storing it in the specified WaveFile. | |
Generate(WaveFile, DTMF, Double) | Generates a single instance of each of the specified dual-tone multi-frequencies storing them in the specified WaveFile. | |
Generate(WaveFile, DTMF, Double, Int32) | Generates the specified dual-tone multi-frequency repeatCount times storing it in the specified WaveFile. | |
Generate(WaveFile, DTMF, Double, Int32) | Generates the specified dual-tone multi-frequencies repeatCount times storing them in the specified WaveFile. | |
GetHashCode | Serves as the default hash function. (Inherited from Object) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
ToString | Returns a string that represents the current object. (Inherited from Object) |
Name | Description | |
---|---|---|
Duration | Frequency duration, in seconds, of DTMF. | |
HighFrequency | High frequency of DTMF. | |
LowFrequency | Low frequency of DTMF. |
Name | Description | |
---|---|---|
GetEnumValueOrDefault |
Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) | |
GetEnumValueOrDefaultT |
Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) |
using System; using GSF.Media; using GSF.Media.Sound; static class Program { static void Main() { WaveFile waveFile = new WaveFile(SampleRate.Hz8000, BitsPerSample.Bits16, DataChannels.Mono); double volume = 0.25D; // Set volume of tones to 25% of maximum DTMF tone; // Get the dial tone dual-frequencies tone = DTMF.DialTone; // Change the duration of the dial-tone to 3 seconds tone.Duration = 3.0D; // Generate a dial tone DTMF.Generate(waveFile, tone, volume); // Generate a busy-signal tone, repeat four times DTMF.Generate(waveFile, DTMF.BusySignal, volume, 4); // Generate an off-the-hook tone, repeat eight times DTMF.Generate(waveFile, DTMF.OffHook, volume, 8); // Get the EBS Alert dual-frequencies tone = DTMF.EmergencyBroadcastSystemAlert; // The official duration of an EBS Alert is 22.5 seconds, but // the noise is rather annoying - so we set it to 4 seconds tone.Duration = 4.0D; // Generate the EBS Alert noise DTMF.Generate(waveFile, tone, volume); // Play all the generated tones waveFile.Play(); Console.ReadKey(); } }