AudioKit / ROMPlayer

AudioKit Sample Player (ROM Player) - EXS24, Sound Font, Wave Player
http://audiokitpro.com
MIT License
532 stars 82 forks source link

Fix issue 4 no sound #5

Closed jokela closed 4 years ago

jokela commented 5 years ago

The .WV filenames in Sounds/samples contained spaces, as did the SFZ references to them. Additionally, the SFZ files referred to AIFFs instead of WVs. Replacing spaces with underscores and ".aif" with ".wv" works for me.

aure commented 5 years ago

Can you tell us the error you were getting before changing these file name references? We are experience a similar bug and wonder if its related.

jokela commented 5 years ago

There was no error, the samples just quietly failed to load. AKSampler+SFZ.swift doesn't seem to account for the case where the sample filename doesn't have a suffix.

Setting enableLogging = true showed that the path was being truncated at the space character: AKSampler+SFZ.swift:loadSFZ(path:fileName:):83:load 48 130.81279 NN range 0-51 vel 0-127 samples/TX

The ".aif" references were a red herring because AKSampler+SFZ.swift will look for .wv files first, even if the sfz file specifies .aif or .wav.

In order to allow space characters in sample filenames, AKSampler+SFZ.swift would need to be changed at line 64:

for part in trimmed.dropFirst(8).components(separatedBy: .whitespaces)