Skip to content

Commit 6640625

Browse files
committed
change the type of tuple in readme.md to clarify
1 parent 164b3db commit 6640625

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _"I'm sorry Dave... I'm afraid I can't do that"_
2121
* Source code for the WAV reading method is at the bottom of this page.
2222

2323
```cs
24-
(IEnumerable<double> audio, int sampleRate) = ReadWAV("hal.wav");
24+
(List<double> audio, int sampleRate) = ReadWAV("hal.wav");
2525
var sg = new SpectrogramGenerator(sampleRate, fftSize: 4096, stepSize: 500, maxFreq: 3000);
2626
sg.Add(audio);
2727
sg.SaveImage("hal.png");
@@ -81,7 +81,7 @@ Review the source code of the demo application for additional details and consid
8181
This example demonstrates how to convert a MP3 file to a spectrogram image. A sample MP3 audio file in the [data folder](data) contains the audio track from Ken Barker's excellent piano performance of George Frideric Handel's Suite No. 5 in E major for harpsichord ([_The Harmonious Blacksmith_](https://en.wikipedia.org/wiki/The_Harmonious_Blacksmith)). This audio file is included [with permission](dev/Handel%20-%20Air%20and%20Variations.txt), and the [original video can be viewed on YouTube](https://www.youtube.com/watch?v=Mza-xqk770k).
8282

8383
```cs
84-
(IEnumerable<double> audio, int sampleRate) = ReadWAV("song.wav");
84+
(List<double> audio, int sampleRate) = ReadWAV("song.wav");
8585

8686
int fftSize = 16384;
8787
int targetWidthPx = 3000;
@@ -117,7 +117,7 @@ Spectrogram (2993, 817)
117117
These examples demonstrate the identical spectrogram analyzed with a variety of different colormaps. Spectrogram colormaps can be changed by calling the `SetColormap()` method:
118118

119119
```cs
120-
(IEnumerable<double> audio, int sampleRate) = ReadWAV("hal.wav");
120+
(List<double> audio, int sampleRate) = ReadWAV("hal.wav");
121121
var sg = new SpectrogramGenerator(sampleRate, fftSize: 8192, stepSize: 200, maxFreq: 3000);
122122
sg.Add(audio);
123123
sg.SetColormap(Colormap.Jet);
@@ -141,7 +141,7 @@ Cropped Linear Scale (0-3kHz) | Mel Scale (0-22 kHz)
141141
Amplitude perception in humans, like frequency perception, is logarithmic. Therefore, Mel spectrograms typically display log-transformed spectral power and are presented using Decibel units.
142142

143143
```cs
144-
(IEnumerable<double> audio, int sampleRate) = ReadWAV("hal.wav");
144+
(List<double> audio, int sampleRate) = ReadWAV("hal.wav");
145145
var sg = new SpectrogramGenerator(sampleRate, fftSize: 4096, stepSize: 500, maxFreq: 3000);
146146
sg.Add(audio);
147147

@@ -166,7 +166,7 @@ SFF files be saved using `Complex` data format (with real and imaginary values f
166166
This example creates a spectrogram but saves it using the SFF file format instead of saving it as an image. The SFF file can then be read in any language.
167167

168168
```cs
169-
(IEnumerable<double> audio, int sampleRate) = ReadWAV("hal.wav");
169+
(List<double> audio, int sampleRate) = ReadWAV("hal.wav");
170170
var sg = new SpectrogramGenerator(sampleRate, fftSize: 4096, stepSize: 700, maxFreq: 2000);
171171
sg.Add(audio);
172172
sg.SaveData("hal.sff");
@@ -210,7 +210,7 @@ plt.show()
210210
You should customize your file-reading method to suit your specific application. I frequently use the NAudio package to read data from WAV and MP3 files. This function reads audio data from a mono WAV file and will be used for the examples on this page.
211211

212212
```cs
213-
(IEnumerable<double> audio, int sampleRate) ReadWAV(string filePath, double multiplier = 16_000)
213+
(List<double> audio, int sampleRate) ReadWAV(string filePath, double multiplier = 16_000)
214214
{
215215
using var afr = new NAudio.Wave.AudioFileReader(filePath);
216216
int sampleRate = afr.WaveFormat.SampleRate;

0 commit comments

Comments
 (0)