Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3953

Suggestions for playing audio (2,500+ short clips) - Stream?

$
0
0

I am currently working on my mobile apps but would eventually like to do this with all platforms (desktop and web in addition to mobile). In my desktop apps, I am utilizing OpenAI’s text-to-speech API to convert the text to audio, sending this back to the app, converting to .mp3, and playing for the user. This works really nicely, and my users love the AI audio as it sounds very human-like

I made up a test project for iOS using a URLConnection connecting to OpenAI’s TTS API, and this also works. The tiny downsides to this approach is 1) it takes a handful of seconds for the process to send the text, convert to audio, send back, and play, and 2) there is a cost involved with using this OpenAI API. It’s not a lot, but it’s an added expense, and depending on the number of users using the feature, it can add up

I am posting this to see what other options I might have. I thought about potentially creating all of the audio files myself and then storing them on a server and retrieving them at will. Problem with this is there would be ~2,500 audio clips. They are relatively small but can get up to 3MB each. My questions:

  • I do have a Xojo Cloud account and was thinking I could store all the files there and retrieve when necessary. I found I could not just add them to the project (wouldn’t accept an .mp3 file drop), but that I could upload these via SFTP to the web app’s Documents folder. At up to 3MB per pop, I would be concerned this would eat up my server’s memory too much, maybe not.
  • If storing on my XC server is a worthwhile approach, how do I access the app’s Documents folder from a desktop/mobile app? Is this done with a URLConnection? I’m just coming off of a flu sickness from the past week and not fully thinking clearly yet. My attention span for coding and searching the net has been limited the past several days.
  • If there are other hosting sites for audio, which would you recommend? Do any of these offer streaming the audio without needing to save to the user’s device?
  • I don’t think I’d want to include all audio clips in the deployed project as this can eat up a lot of the user’s device storage
  • Or, do I just stick with the URLConnection to the OpenAI API?

Using Xojo 2024 r3

10 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 3953

Trending Articles