Skip to content

Commit

Permalink
Move kivy.core.audio to kivy.core.audio_output, reserve `kivy.cor…
Browse files Browse the repository at this point in the history
…e.audio_input` for future use #8579 (#8721)

* Renamed kivy.core.audio to kivy.core.audio_output

* Corrected the documentation comment in init.py

* Refactored kivy.core.audio calls in C files

* Reserved audio_input module

* Rename kivy_options from audio to audio_output and changing core_register_libs audio_output call   Change test function calls

* Cleanup of unrelated files

* Fix broken references

---------

Co-authored-by: vikingmidia <[email protected]>
Co-authored-by: Mirko Galimberti <[email protected]>
  • Loading branch information
3 people committed Jul 1, 2024
1 parent f1e8c4b commit b395800
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion doc/autobuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 30,7 @@
import kivy.metrics
import kivy.atlas
import kivy.context
import kivy.core.audio
import kivy.core.audio_output
import kivy.core.camera
import kivy.core.clipboard
import kivy.core.gl
Expand Down
2 changes: 1 addition & 1 deletion examples/audio/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 17,7 @@
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.core.audio import SoundLoader
from kivy.core.audio_output import SoundLoader
from kivy.properties import StringProperty, ObjectProperty, NumericProperty
from glob import glob
from os.path import dirname, join, basename
Expand Down
2 changes: 1 addition & 1 deletion examples/audio/pitch.py
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
# encoding: utf8

from kivy.app import App
from kivy.core.audio import SoundLoader
from kivy.core.audio_output import SoundLoader
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button

Expand Down
2 changes: 1 addition & 1 deletion kivy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 210,7 @@ def kivy_usage():
'text': ('pil', 'sdl2', 'sdlttf'),
'video': (
'gstplayer', 'ffmpeg', 'ffpyplayer', 'null'),
'audio': (
'audio_output': (
'gstplayer', 'ffpyplayer', 'sdl2',
'avplayer'),
'image': ('tex', 'imageio', 'dds', 'sdl2', 'pil', 'ffpy', 'gif'),
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,10 1,10 @@
'''
Audio
Audio Output
=====
Load an audio sound and play it with::
from kivy.core.audio import SoundLoader
from kivy.core.audio_output import SoundLoader
sound = SoundLoader.load('mytest.wav')
if sound:
Expand Down Expand Up @@ -218,4 218,4 @@ def on_stop(self):
if USE_SDL2:
audio_libs = [('sdl2', 'audio_sdl2')]

libs_loaded = core_register_libs('audio', audio_libs)
libs_loaded = core_register_libs('audio_output', audio_libs)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 6,7 @@

from jnius import autoclass, java_method, PythonJavaClass
from android import api_version
from kivy.core.audio import Sound, SoundLoader
from kivy.core.audio_output import Sound, SoundLoader


MediaPlayer = autoclass("android.media.MediaPlayer")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 5,7 @@

__all__ = ('SoundAvplayer', )

from kivy.core.audio import Sound, SoundLoader
from kivy.core.audio_output import Sound, SoundLoader
from pyobjus import autoclass, protocol
from pyobjus.dylib_manager import load_framework, INCLUDE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 55,7 @@

from kivy.clock import Clock
from kivy.logger import Logger
from kivy.core.audio import Sound, SoundLoader
from kivy.core.audio_output import Sound, SoundLoader
from kivy.weakmethod import WeakMethod
import time

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 10,7 @@
'''

from kivy.lib.gstplayer import GstPlayer, get_gst_version
from kivy.core.audio import Sound, SoundLoader
from kivy.core.audio_output import Sound, SoundLoader
from kivy.logger import Logger
from kivy.clock import Clock
from os.path import realpath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 44,7 @@ __all__ = ('SoundSDL2', 'MusicSDL2')
include "../../../kivy/lib/sdl2.pxi"
include "../../../kivy/graphics/common.pxi" # For malloc and memcpy (on_pitch)

from kivy.core.audio import Sound, SoundLoader
from kivy.core.audio_output import Sound, SoundLoader
from kivy.logger import Logger
from kivy.clock import Clock

Expand Down
6 changes: 3 additions & 3 deletions kivy/tests/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 20,8 @@ class AudioTestCase(unittest.TestCase):
def get_sound(self):
import os
assert os.path.exists(SAMPLE_FILE)
from kivy.core import audio
return audio.SoundLoader.load(SAMPLE_FILE)
from kivy.core import audio_output
return audio_output.SoundLoader.load(SAMPLE_FILE)

def test_length_simple(self):
sound = self.get_sound()
Expand Down Expand Up @@ -58,5 58,5 @@ def test_length_stopped(self):
class AudioGstreamerTestCase(AudioTestCase):

def make_sound(self, source):
from kivy.core.audio import audio_gstreamer
from kivy.core.audio_output import audio_gstreamer
return audio_gstreamer.SoundGstreamer(source)
2 changes: 1 addition & 1 deletion kivy/tools/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 116,7 @@ def send_report(dict_report):
report = []

title('Core selection')
from kivy.core.audio import SoundLoader
from kivy.core.audio_output import SoundLoader
report.append('Audio = %s' % SoundLoader._classes)
from kivy.core.camera import Camera
report.append('Camera = %s' % Camera)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 979,7 @@ def determine_sdl2():
for source_file in ('core/window/_window_sdl2.pyx',
'core/image/_img_sdl2.pyx',
'core/text/_text_sdl2.pyx',
'core/audio/audio_sdl2.pyx',
'core/audio_output/audio_sdl2.pyx',
'core/clipboard/_clipboard_sdl2.pyx'):
sources[source_file] = merge(
base_flags, sdl2_flags, sdl2_depends)
Expand Down

0 comments on commit b395800

Please sign in to comment.