wave-d 1.0.8
WAV file loader/emitter.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
What's this?
wave-d is a tiny library to load/save WAV audio files.
Licenses
See UNLICENSE.txt
Usage
import std.stdio;
import waved;
void main()
{
// Loads a WAV file in memory
Sound input = decodeWAV("my_wav_file.wav");
writefln("channels = %s", input.channels);
writefln("samplerate = %s", input.sampleRate);
writefln("samples = %s", input.samples.length);
// Only keep the first channel (left)
input = input.makeMono();
// Multiply the left channel by 2 in-place
foreach(i; 0..input.lengthInFrames)
input.sample(0, i) *= 2.0f;
// Duplicate the left channel, saves a two channels WAV file out of it
float[][] channels = [input.channel(0), input.channel(0)];
Sound(input.sampleRate, channels).encodeWAV("amplified-2x.wav");
}
- Registered by ponce
- 1.0.8 released 3 years ago
- d-gamedev-team/wave-d
- github.com/d-gamedev-team/wave-d/
- public domain
- Authors:
- Dependencies:
- none
- Versions:
-
1.0.8 2021-Dec-30 1.0.7 2018-May-23 1.0.6 2016-Dec-07 1.0.5 2016-Dec-01 1.0.4 2016-Nov-17 - Download Stats:
-
-
0 downloads today
-
1 downloads this week
-
1 downloads this month
-
75286 downloads total
-
- Score:
- 1.3
- Short URL:
- wave-d.dub.pm