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) {
|
||||
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;
|
||||
}
|
||||
// copy file to target file
|
||||
|
|
|
@ -332,7 +332,7 @@ NSMutableDictionary *soundtimers;
|
|||
NSString *path;
|
||||
while ((path = [enumerator nextObject]) != nil) {
|
||||
// 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];
|
||||
// extract file
|
||||
NSString *toPath = [[IO getpath] stringByAppendingPathComponent:fileName];
|
||||
|
|
|
@ -86,7 +86,7 @@ export default class ScratchAudio {
|
|||
var dir = '';
|
||||
if (!isAndroid) {
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue