Skip to content

Commit 142f54e

Browse files
authored
Merge pull request #3459 from emlyn/mp3
Update docs to mention that mp3s are supported.
2 parents 4520ebf + b225fec commit 142f54e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

app/server/ruby/lib/sonicpi/lang/sound.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,7 +2114,7 @@ def sample_loaded?(*args)
21142114
doc name: :sample_loaded?,
21152115
introduced: Version.new(2,2,0),
21162116
summary: "Test if sample was pre-loaded",
2117-
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` file, returns `true` if the sample has already been loaded.",
2117+
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` file, returns `true` if the sample has already been loaded.",
21182118
args: [[:path, :string]],
21192119
opts: nil,
21202120
accepts_block: false,
@@ -2132,7 +2132,7 @@ def load_sample(*args)
21322132
doc name: :load_sample,
21332133
introduced: Version.new(2,0,0),
21342134
summary: "Pre-load first matching sample",
2135-
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` file, pre-loads the sample into memory.
2135+
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` file, pre-loads the sample into memory.
21362136
21372137
You may also specify the same set of source and filter pre-args available to `sample` itself. `load_sample` will then load all matching samples. See `sample`'s docs for more information." ,
21382138
args: [[:path, :string]],
@@ -2162,7 +2162,7 @@ def load_samples(*args)
21622162
doc name: :load_samples,
21632163
introduced: Version.new(2,0,0),
21642164
summary: "Pre-load all matching samples",
2165-
doc: "Given a directory containing multiple `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` files, pre-loads all the samples into memory.
2165+
doc: "Given a directory containing multiple `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` files, pre-loads all the samples into memory.
21662166
21672167
You may also specify the same set of source and filter pre-args available to `sample` itself. `load_sample` will load all matching samples (not just the sample `sample` would play given the same opts) - see `sample`'s docs for more information." ,
21682168
args: [[:paths, :list]],
@@ -2278,7 +2278,7 @@ def sample_duration(*args)
22782278
doc name: :sample_duration,
22792279
introduced: Version.new(2,0,0),
22802280
summary: "Get duration of sample in beats",
2281-
doc: "Given the name of a loaded sample, or a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` file returns the length of time in beats that the sample would play for. `sample_duration` understands and accounts for all the opts you can pass to `sample` which have an effect on the playback duration such as `rate:`. The time returned is scaled to the current BPM.
2281+
doc: "Given the name of a loaded sample, or a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` file returns the length of time in beats that the sample would play for. `sample_duration` understands and accounts for all the opts you can pass to `sample` which have an effect on the playback duration such as `rate:`. The time returned is scaled to the current BPM.
22822282
22832283
*Note:* avoid using `sample_duration` to set the sleep time in `live_loop`s, prefer stretching the sample with the `beat_stretch:` opt or changing the BPM instead. See the examples below for details.",
22842284
args: [[:path, :string]],
@@ -2528,7 +2528,7 @@ def sample(*args, &blk)
25282528
doc name: :sample,
25292529
introduced: Version.new(2,0,0),
25302530
summary: "Trigger sample",
2531-
doc: "Play back a recorded sound file (sample). Sonic Pi comes with lots of great samples included (see the section under help) but you can also load and play `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` files from anywhere on your computer too. To play a built-in sample use the corresponding keyword such as `sample :bd_haus`. To play any file on your computer use a full path such as `sample \"/path/to/sample.wav\"`.
2531+
doc: "Play back a recorded sound file (sample). Sonic Pi comes with lots of great samples included (see the section under help) but you can also load and play `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` files from anywhere on your computer too. To play a built-in sample use the corresponding keyword such as `sample :bd_haus`. To play any file on your computer use a full path such as `sample \"/path/to/sample.wav\"`.
25322532
25332533
There are many opts for manipulating the playback. For example, the `rate:` opt affects both the speed and the pitch of the playback. To control the rate of the sample in a pitch-meaningful way take a look at the `rpitch:` opt.
25342534
@@ -3452,7 +3452,7 @@ def normalise_args!(args_h, defaults={})
34523452

34533453
# TODO - this method doesn't seem to be used
34543454
def find_sample_with_path(path)
3455-
["wav", "wave", "aif", "aiff","flac", "ogg", "oga"].each do |ext|
3455+
["wav", "wave", "aif", "aiff","flac", "ogg", "oga", "mp3"].each do |ext|
34563456
full = "#{path}.#{ext}"
34573457
return full if File.exist?(full)
34583458
end

etc/doc/tutorial/03.6-External-Samples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ something to consider.
2525

2626
## Local Samples
2727

28-
So how do you play any arbitrary WAV, AIFF, OGG, OGA or FLAC file on your computer?
28+
So how do you play any arbitrary WAV, AIFF, OGG, OGA, FLAC or MP3 file on your computer?
2929
All you need to do is pass the path of that file to `sample`:
3030

3131
```

etc/doc/tutorial/03.7-Sample-Packs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ of potential candidates. A source can take two forms:
145145
The `sample` fn will first gather all sources and use them to create a
146146
large list of candidates. This list is constructed by first adding all
147147
valid paths and then by adding all the valid `.flac`, `.aif`, `.aiff`,
148-
`.wav`, `.wave` files contained within the directories.
148+
`.wav`, `.wave`, `.mp3` files contained within the directories.
149149

150150
For example, take a look at the following code:
151151

0 commit comments

Comments
 (0)