-
-
Notifications
You must be signed in to change notification settings - Fork 31
Sampler envelope fix #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,26 @@ class SamplerTests: XCTestCase { | |
| sampler.stop(noteNumber: 88) | ||
| testMD5(audio) | ||
| } | ||
|
|
||
|
|
||
| func testSamplerAttackVolumeEnvelope() { | ||
| let engine = AudioEngine() | ||
| let sampleURL = Bundle.module.url(forResource: "TestResources/12345", withExtension: "wav")! | ||
| let file = try! AVAudioFile(forReading: sampleURL) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Force Try Violation: Force tries should be avoided. (force_try) |
||
| let sampler = Sampler() | ||
| sampler.load(avAudioFile: file) | ||
| sampler.masterVolume = 1 | ||
| engine.output = sampler | ||
| let audio = engine.startTest(totalDuration: 8.0) | ||
| audio.append(engine.render(duration: 1.0)) //run test for a second before setting parameters | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing) |
||
| sampler.attackDuration = 1.0 | ||
| sampler.load(avAudioFile: file) | ||
| audio.append(engine.render(duration: 1.0))//run test to give time to load | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing) |
||
| sampler.play(noteNumber: 65, velocity: 127) | ||
| audio.append(engine.render(duration: 6.0)) | ||
| sampler.stop(noteNumber: 65) | ||
| testMD5(audio) | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace) |
||
| /// Run this test with thread sanitizer. | ||
| func testSamplerThreadSafety() { | ||
| let engine = AudioEngine() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)