mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
add support to handle mp3 sound
This commit is contained in:
parent
d32d2214e7
commit
d656f28ca8
3 changed files with 3 additions and 3 deletions
|
@ -324,7 +324,7 @@ public class IOManager {
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!(entry.endsWith(".png") || entry.endsWith(".wav") || entry.endsWith(".svg"))) {
|
if (!(entry.endsWith(".png") || entry.endsWith(".wav") || entry.endsWith(".mp3") || entry.endsWith(".svg"))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// copy file to target file
|
// copy file to target file
|
||||||
|
|
|
@ -332,7 +332,7 @@ NSMutableDictionary *soundtimers;
|
||||||
NSString *path;
|
NSString *path;
|
||||||
while ((path = [enumerator nextObject]) != nil) {
|
while ((path = [enumerator nextObject]) != nil) {
|
||||||
// we are only interested in images and sounds
|
// we are only interested in images and sounds
|
||||||
if ([path hasSuffix:@".png"] || [path hasSuffix:@".wav"] || [path hasSuffix:@".svg"]) {
|
if ([path hasSuffix:@".png"] || [path hasSuffix:@".wav"] || [path hasSuffix:@".mp3"] || [path hasSuffix:@".svg"]) {
|
||||||
NSString *fileName = [path lastPathComponent];
|
NSString *fileName = [path lastPathComponent];
|
||||||
// extract file
|
// extract file
|
||||||
NSString *toPath = [[IO getpath] stringByAppendingPathComponent:fileName];
|
NSString *toPath = [[IO getpath] stringByAppendingPathComponent:fileName];
|
||||||
|
|
|
@ -86,7 +86,7 @@ export default class ScratchAudio {
|
||||||
var dir = '';
|
var dir = '';
|
||||||
if (!isAndroid) {
|
if (!isAndroid) {
|
||||||
if (md5.indexOf('/') > -1) dir = 'HTML5/';
|
if (md5.indexOf('/') > -1) dir = 'HTML5/';
|
||||||
else if (md5.indexOf('wav') > -1) dir = 'Documents';
|
else if (md5.indexOf('wav') > -1 || md5.indexOf('mp3') > -1) dir = 'Documents';
|
||||||
}
|
}
|
||||||
ScratchAudio.loadFromLocal(dir, md5, fcn);
|
ScratchAudio.loadFromLocal(dir, md5, fcn);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue