Skip to content
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

dB HL Tone Audiometry - 'NSDecimalNumber overflow exception' #1336

Open
rogelj opened this issue Feb 10, 2020 · 2 comments
Open

dB HL Tone Audiometry - 'NSDecimalNumber overflow exception' #1336

rogelj opened this issue Feb 10, 2020 · 2 comments

Comments

@rogelj
Copy link

rogelj commented Feb 10, 2020

I am trying to use the dBHLToneAudiometryTask but when I try to run the application I get the following error:

*** Terminating app due to uncaught exception 'NSDecimalNumberOverflowException', reason: 'NSDecimalNumber overflow exception'

Screenshot 2020-02-10 at 17 58 19

I have also tried running the ORKCatalog example in the repo and I get the same error. Any hints would be most welcome.

I call the task as follows:

@IBAction func startdbHL(_ sender: Any) {
    let dbHLAudio = ORKOrderedTask.dBHLToneAudiometryTask(withIdentifier: "dbHKAudio",
        intendedUseDescription: "We'll test your hearing",
        options: ORKPredefinedTaskOption())
        
    showTask(dbHLAudio)
    print(dbHLAudio)
}

private func showTask(_ task: ORKTask) {
    let taskViewController = ORKTaskViewController(task: task, taskRun: nil)
    taskViewController.delegate = self
    present(taskViewController, animated: true, completion: nil)
}
@rogelj
Copy link
Author

rogelj commented Feb 11, 2020

I have narrowed it down to this line (345) in ORKdBHLToneAudiometryAudioGenerator.m

NSDecimalNumber *updated_dBSPLForVolumeCurve = [dBSPL decimalNumberByAdding:offsetDueToVolume];

Will continue investigating, but any hints are more than welcome!

@rogelj
Copy link
Author

rogelj commented Feb 11, 2020

OK, it seems that the _sensitivityPerFrequency and _retspl are not being set up as the headphones variable is not set. Appropriate code has been written for the _volumeCurve. There appropriate .plists for the two Dictionaries may need to be revised. Will try to open a pull request to sort this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant