AVSpeechSynthesizer behaves strangely for money amount that starts with $13 or $14
Originator: | hong.rich | ||
Number: | rdar://46031623 | Date Originated: | 13-Nov-2018 12:45 PM |
Status: | Closed | Resolved: | |
Product: | iOS + SDK | Product Version: | iOS 12.1 (16B92) |
Classification: | UI/Usability | Reproducible: | Always |
Summary: AVSpeechSynthesizer appears to behave very strangely when asking it to speak money amounts that starts with $13 or $14. It speaks most money amounts exactly as one would expect. For example, “$42 million” is spoken as “42 million dollars” which is expected. However, it appears to speak incorrectly when the money amount starts with either “$13” or “$14” and ends in either “million”, “billion”, or “trillion”. The number part could be anything from “13.x”, “14.x”, “13x”, “14x”, “13”, “14” where “x” is any digit. This can be reproduced easily using Swift Playgrounds on an iPad. Steps below include some examples and how to reproduce this issue. Steps to Reproduce: 1. Open Playgrounds on iPad 2. Create a new playground and paste in the following code ``` import AVFoundation let strings = [ "$13.3 million", "$14.3 million", "$13.3 billion", "$14.3 billion", "$134 million", "$143 million", "$134 billion", "$143 billion", ] for string in strings { let utterane = AVSpeechUtterance(string: string) let synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterane) Thread.sleep(forTimeInterval: 3) } ``` 3. Tap on “Run My Code” Expected Results: The following should be spoken: ``` 13 point 3 million dollars 14 point 3 million dollars 13 point 3 billion dollars 14 point 3 billion dollars 134 million dollars 143 million dollars 134 billion dollars 143 billion dollars ``` Actual Results: The following are actually spoken: ``` 13 dollars and 30 cents million 14 dollars and 30 cents million 13 dollars and 30 cents billion 14 dollars and 30 cents billion 134 dollars million 143 dollars million 134 dollars billion 143 dollars billion ``` Version: iOS 12.1 (16B92) Notes: iOS 12.1 (16B92) iPad Pro 11-inch (2018) Language: English (Canada) Region: United States
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!