Coder Social home page Coder Social logo

aflorithmic / apiaudio-python Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 4.0 9.17 MB

api.audio Python SDK

Home Page: https://www.api.audio

License: MIT License

Python 98.11% Shell 1.77% Makefile 0.13%
python-sdk speech sound speech-audio mastering audio audio-production voice tts python

apiaudio-python's People

Contributors

a96lex avatar codebooster97 avatar fear6077 avatar li-create2021 avatar lindabedrani avatar lindakivine avatar mariamantalena4 avatar martinezpl avatar renovate-bot avatar sjhunt93 avatar springcoil avatar tonythree avatar username504 avatar zeritte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

apiaudio-python's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • aws-cli 3.1
  • slack 4.9.3
  • returntocorp/semgrep-agent v1
  • cimg/python 3.8

  • Check this box to trigger a request for Renovate to run again on this repository

Outdated docs

Hello,
I copy pasted the code from this page: https://docs.api.audio/recipes/hello-world-create-your-first-audio-track

For future reference it displays this code:

#Check that you are using python 3.8 or further 
#pip install -U apiaudio
import apiaudio
# Make sure to import your API key
apiaudio.api_key ="xxxxxx"

# Let's create a script and have the text as Hello World!
script = apiaudio.Script().create(scriptText="""
   <<soundSegment::intro>>
   <<sectionName::intro>> 
   Hello world. Welcome to API dot audio.
   <<soundSegment::main>>
   <<sectionName::main>>
   Create audio in a few easy steps. Use sound templates and effects. <break time = '1s'/>
   <<soundSegment::outro>> 
   <<sectionName::outro>>
   We're excited to see what you build!
""", scriptName="helloworld", moduleName="hello", projectName="hello")
print(script)

# Create text to speech 
# Choose a voice! https://library.api.audio/speakers
response = apiaudio.Speech().create(scriptId=script.get("scriptId"), voice="Joanna")
print(response)
template="parisianmorning"
# Now lets add audio to the speech file and master it with high quality
response = apiaudio.Mastering().create(
	scriptId=script.get("scriptId"),
	soundTemplate=template
	)
print(response)

# retrieve mastered file and download to your local folder
file = apiaudio.Mastering().download(scriptId=script.get("scriptId"), destination=".")
print(file)

The last line doesn't work, I'm getting:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-c977554b0c8f> in <module>
----> 1 file = apiaudio.Mastering().download(scriptId=script.get("scriptId"), destination=".")

~/Code/dev-env/lib/python3.9/site-packages/apiaudio/helper_classes.py in download(cls, scriptId, section, parameters, public, vast, destination)
     55 
     56         if "url" in audio_files.keys():
---> 57             local_filename = cls._download_request(
     58                 url=audio_files.get("url"), destination=destination
     59             )

~/Code/dev-env/lib/python3.9/site-packages/apiaudio/api_request.py in _download_request(cls, url, destination)
     59     @classmethod
     60     def _download_request(cls, url, destination):
---> 61         local_filename = f"{destination}/{url.split('/')[-1].split('?')[0]}"
     62         local_filename = local_filename.replace("%243ct10n", "section")
     63 

AttributeError: 'bool' object has no attribute 'split'

My version of apiaudio is 0.8.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.