Commit graph

60 commits

Author SHA1 Message Date
Jackson Harper
3e4f9409df Dont fully close audio player on error
This gives users the ability to change the selected language if
the error was related to language / voice.
2022-12-01 12:50:59 +08:00
Jackson Harper
d7290044a8 Save listen position independent of read position when listening to articles
When you restart an audio session it will start at the previous
listen position.
2022-11-24 13:58:30 +08:00
Jackson Harper
be941faf39 Handle case where AVQueuePlayer doesnt update the current item for shorter audio segments 2022-11-11 15:55:28 +08:00
Jackson Harper
6ba5b6165b Pass in feature auth header for TTS if set 2022-11-11 15:55:28 +08:00
Jackson Harper
a4419e58bc WIP: toggle for realistic voices 2022-11-11 15:55:28 +08:00
Jackson Harper
59271882a5 Use currentAudioIndex, this will give us the option to force it to a differnt value
Sometimes the play item isn't updated very quickly, the timeElapsed
can be greater than the duration in those cases. We could probably
force the currentItemIndex to increment in those cases to get
speech cards to update.
2022-11-11 15:55:28 +08:00
Jackson Harper
878cb51533 Separate out the speechplayeritem class, implement a queued prefetch 2022-11-11 15:55:28 +08:00
Jackson Harper
5865be5982 Update ultra voice list 2022-11-11 15:55:28 +08:00
Jackson Harper
48b0ea09bd Add sample voice files / Stop sample voices when unpausing 2022-11-11 15:55:28 +08:00
Jackson Harper
b47b1ca49a Add samples for voices 2022-11-11 15:55:28 +08:00
Jackson Harper
3d9976e06a WIP: Adding ultra realistic voice support 2022-11-11 15:55:28 +08:00
Jackson Harper
bafe1bd338 Ensure the audio index is updated when items are changed 2022-10-13 15:04:57 +08:00
Jackson Harper
2e9bda7835 Dont instantiate TabView with zero items
Seems this prevents the crash when the TabView tries to set
its index to 0/0.
2022-10-13 14:02:17 +08:00
Satindar Dhillon
8fcbfbbd2e fixes after rebasing 2022-10-12 12:58:32 -07:00
Satindar Dhillon
c287eb4a59 add os conditionals so the mac app compiles 2022-10-12 10:11:09 -07:00
Jackson Harper
25055598e3 Update read position while listening to audio 2022-10-11 17:22:40 +08:00
Jackson Harper
68f9d9d1da Give the audio controller access to the dataService so it can update read positions 2022-10-11 16:20:04 +08:00
Jackson Harper
ca725b4908 Improve text to speech follow UX 2022-10-06 12:34:15 +08:00
Jackson Harper
b983a4336b Dont try to highlight beyond the last item despite speech marks offset data 2022-10-06 12:34:15 +08:00
Jackson Harper
f9e2809a10 WIP: follow along text for tts 2022-10-06 12:34:15 +08:00
Jackson Harper
59d6ae583b Disable audio preload by default 2022-09-30 13:21:55 +08:00
Jackson Harper
247fcf0eb3 Dont display loading indicator if audio is not playing when voice is changed 2022-09-26 20:46:28 +08:00
Jackson Harper
f902f74cd2 Refactor voices code, show an indicator when switching voices 2022-09-26 17:19:24 +08:00
Jackson Harper
ecdf45e447 Remove Change Language button, add German and Spanish options 2022-09-26 11:34:20 +08:00
Jackson Harper
09bea6d8c1 Improve byline display, centralize the code a bit 2022-09-24 10:05:04 +08:00
Jackson Harper
d11091a458 Make tts preload optional, use headphones for tts icon, language ux 2022-09-23 16:38:21 +08:00
Jackson Harper
461100d359 Better voice selection, handle failures fetching audio, handle seeking when paused better 2022-09-23 14:06:13 +08:00
Jackson Harper
e249a97bfd Improve the UI for voice selection 2022-09-22 22:57:54 +08:00
Jackson Harper
89fd9b9f0c Add audio session events 2022-09-22 12:05:32 +08:00
Jackson Harper
a23760a296 A few bug fixes
- Only set durations if we have successfully loaded
audio data.

- Use weak self in the completion handler so we clean up
properly.

- Handle cases where there are no utterances in a document

- When a user selects to download audio, force overwrite
the cached data.
2022-09-20 21:57:52 +08:00
Jackson Harper
8c71c0b384 Make Christopher the default voice, fix linter warnings 2022-09-20 16:07:30 +08:00
Jackson Harper
d05c030501 Remove the playbackTask. This is now handled by AVPlayer 2022-09-20 16:00:31 +08:00
Jackson Harper
40adb4c4a8 Generate a queue of player items when speech synthesis starts
This should better handle cases where playback catches up to
audio synthesis/download, and will have the player items put
into a wait state.

This does make seeking a little less performant, as AVPlayer
wont aggresively pre-load as we were before.
2022-09-19 17:34:44 +08:00
Jackson Harper
1a338e8854 Reset the scrub state after seeking 2022-09-15 15:54:39 +08:00
Jackson Harper
9c3b9f0523 Dont update the scrub state from the timer
This prevents the slider from jumping back during a seek operation.
2022-09-15 15:18:50 +08:00
Jackson Harper
fa9780722f Only update nowPlaying data if the timeElapsed is accurately calculated 2022-09-15 14:08:15 +08:00
Jackson Harper
de73c81345 Pause player before seeking into another player item. fireTimer if seeking within 2022-09-15 14:07:37 +08:00
Jackson Harper
460ba07e30 Update UI after seeking, dont try to detect end of stream using currentTime
This helps with two issues:
- after seeking sometimes you will see the loading spinner even
after audio has resumed.

- sometimes if we are still pulling data we might detect that
we are at the end of the stream.
2022-09-15 13:42:48 +08:00
Jackson Harper
bc0f2f1b97 Clean up memory handling in the audio controller
Ideally this wouldn't need a ref to the synthesizer either.
2022-09-14 22:10:12 +08:00
Jackson Harper
56441b5958 Download audio artwork 2022-09-13 17:06:38 +08:00
Jackson Harper
e73072e224 Updates after rebasing, implement download for offline audio 2022-09-13 16:03:34 +08:00
Satindar Dhillon
9b1ce21f6f remove explicit try call for decoding SpeechDocument 2022-09-13 15:27:48 +08:00
Satindar Dhillon
c4152a05a0 create a LinkedItemAudioProperties struct that can be passed to AudioController (instead of passing LinkedItem) 2022-09-13 15:27:48 +08:00
Jackson Harper
bc9b0b0752 Increase timer interval, better handling of seeking near the bounds of audio 2022-09-13 15:27:48 +08:00
Jackson Harper
e39888158d Better handling of end of stream detection 2022-09-13 15:27:48 +08:00
Jackson Harper
ab7d34337f Improve voice changing during playback 2022-09-13 15:27:48 +08:00
Jackson Harper
73841bc2da Implement voice switching during playback
This assumes voices are approx the same duration, which is
more accurate than rebuilding durations off of the estimates.
2022-09-13 15:27:48 +08:00
Jackson Harper
f5c5cd76ec When seeking into a new player item make sure we seek to the correct offset 2022-09-13 15:27:48 +08:00
Jackson Harper
6c2333fd65 Update durations when playback rate changes. Fire timer to update UI 2022-09-13 15:27:48 +08:00
Jackson Harper
8c4c88a51a Recalculate durations when speed is changed 2022-09-13 15:27:48 +08:00