Skip to content

Commit

Permalink
dont use ffmpeg or ffplay in github
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Feb 5, 2024
1 parent d7e682b commit 2b98935
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
12 changes: 8 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

from elevenlabs import generate, voices, Voice, VoiceSettings, play, stream
from .utils import IN_GITHUB


def test_voices() -> None:
Expand All @@ -15,7 +16,8 @@ def test_generate() -> None:
settings=VoiceSettings(stability=0.71, similarity_boost=0.5, style=0.0, use_speaker_boost=True)
)
)
play(audio) # type: ignore
if not IN_GITHUB:
play(audio) # type: ignore


def test_generate_stream() -> None:
Expand All @@ -29,8 +31,9 @@ def text_stream():
model="eleven_monolingual_v1",
stream=True
)

stream(audio_stream) # type: ignore

if not IN_GITHUB:
stream(audio_stream) # type: ignore


def test_generate_with_settings() -> None:
Expand All @@ -44,4 +47,5 @@ def test_generate_with_settings() -> None:
)
)

play(audio) # type: ignore
if not IN_GITHUB:
play(audio) # type: ignore
11 changes: 6 additions & 5 deletions tests/test_voice.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from elevenlabs.client import ElevenLabs
from elevenlabs.types.voice_response import VoiceResponse
from .utils import use_play

import pytest
from .utils import IN_GITHUB


def test_voice_from_id():
Expand Down Expand Up @@ -58,7 +56,8 @@ def test_voice_clone():

client.voices.delete(voice.voice_id)

play(audio)
if not IN_GITHUB:
play(audio)


def test_voice_design():
Expand All @@ -81,7 +80,9 @@ def test_voice_design():
)

assert isinstance(audio, bytes) and len(audio) > 0
play(audio)

if not IN_GITHUB:
play(audio)



Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import requests # type: ignore

use_play = "PLAY" in os.environ
IN_GITHUB = "GITHUB_ACTIONS" in os.environ


@contextmanager
Expand Down

0 comments on commit 2b98935

Please sign in to comment.