diff --git a/content.py b/content.py index 45dd940a2..ad09ef71e 100644 --- a/content.py +++ b/content.py @@ -1441,6 +1441,10 @@ def save_media_in_form_post(media_bytes, debug: bool, 'ogv': 'video/ogv', 'mp3': 'audio/mpeg', 'ogg': 'audio/ogg', + 'wav': 'audio/vnd.wave', + 'wav2': 'audio/wav', + 'wav3': 'audio/x-wav', + 'wav4': 'audio/x-pn-wave', 'opus': 'audio/opus', 'spx': 'audio/speex', 'flac': 'audio/flac', @@ -1460,6 +1464,12 @@ def save_media_in_form_post(media_bytes, debug: bool, extension = 'mp3' elif extension == 'csv2': extension = 'csv' + elif extension == 'wav2': + extension = 'wav' + elif extension == 'wav3': + extension = 'wav' + elif extension == 'wav4': + extension = 'wav' if filename_base: filename = filename_base + '.' + extension search_lst = search_str.decode().split('/', maxsplit=1) diff --git a/epicyon.py b/epicyon.py index 811bae57b..f064d75a8 100644 --- a/epicyon.py +++ b/epicyon.py @@ -1222,7 +1222,7 @@ def _command_options() -> None: # comma separated list of preferred audio formats. eg. "opus", "mp3", "spx" # in order of preference - preferred_podcast_formats = ['ogg', 'mpeg', 'opus', 'spx'] + preferred_podcast_formats = ['ogg', 'mpeg', 'opus', 'spx', 'wav'] if argb.podcast_formats: podcast_formats_str = argb.podcast_formats else: diff --git a/media.py b/media.py index 2a62d98f9..92b6d0375 100644 --- a/media.py +++ b/media.py @@ -670,6 +670,7 @@ def path_is_audio(path: str) -> bool: path.endswith('.opus') or \ path.endswith('.spx') or \ path.endswith('.flac') or \ + path.endswith('.wav') or \ path.endswith('.mp3'): return True return False diff --git a/metadata.py b/metadata.py index 56f4d4bbe..f6db54e23 100644 --- a/metadata.py +++ b/metadata.py @@ -193,6 +193,10 @@ def meta_data_instance(show_accounts: bool, 'video/mp4', 'video/ogv', 'audio/ogg', + 'audio/wav', + 'audio/x-wav', + 'audio/x-pn-wave', + 'audio/vnd.wave', 'audio/opus', 'audio/speex', 'audio/x-speex', diff --git a/outbox.py b/outbox.py index 16d5befb5..a3313554e 100644 --- a/outbox.py +++ b/outbox.py @@ -353,6 +353,10 @@ def post_message_to_outbox(session, translate: {}, "avif": "avif", "audio/mpeg": "mp3", "ogg": "ogg", + "audio/wav": "wav", + "audio/x-wav": "wav", + "audio/x-pn-wave": "wav", + "audio/vnd.wave": "wav", "flac": "flac", "opus": "opus", "audio/speex": "spx", diff --git a/utils.py b/utils.py index c1d6567fb..a6abd5c8b 100644 --- a/utils.py +++ b/utils.py @@ -490,7 +490,7 @@ def get_video_extensions() -> []: def get_audio_extensions() -> []: """Returns a list of the possible audio file extensions """ - return ('mp3', 'ogg', 'flac', 'opus', 'spx') + return ('mp3', 'ogg', 'flac', 'opus', 'spx', 'wav') def get_image_extensions() -> []: @@ -2897,6 +2897,10 @@ def media_file_mime_type(filename: str) -> str: 'ico': 'image/x-icon', 'mp3': 'audio/mpeg', 'ogg': 'audio/ogg', + 'audio/wav': 'wav', + 'audio/x-wav': 'wav', + 'audio/x-pn-wave': 'wav', + 'wav': 'audio/vnd.wave', 'opus': 'audio/opus', 'spx': 'audio/speex', 'flac': 'audio/flac', diff --git a/webapp_media.py b/webapp_media.py index 46427ee3b..f91ae26a2 100644 --- a/webapp_media.py +++ b/webapp_media.py @@ -275,10 +275,11 @@ def _add_embedded_video_from_sites(translate: {}, content: str, def _add_embedded_audio(translate: {}, content: str) -> str: - """Adds embedded audio for mp3/ogg/opus + """Adds embedded audio for mp3/ogg/opus/wav """ if not ('.mp3' in content or '.ogg' in content or + '.wav' in content or '.opus' in content or '.spx' in content or '.flac' in content): @@ -290,6 +291,8 @@ def _add_embedded_audio(translate: {}, content: str) -> str: extension = '.mp3' if '.ogg' in content: extension = '.ogg' + elif '.wav' in content: + extension = '.wav' elif '.opus' in content: extension = '.opus' elif '.spx' in content: diff --git a/webapp_podcast.py b/webapp_podcast.py index 25108df52..4388b4d83 100644 --- a/webapp_podcast.py +++ b/webapp_podcast.py @@ -358,6 +358,8 @@ def html_podcast_episode(translate: {}, audio_extension = 'spx' elif '.flac' in link_url: audio_extension = 'flac' + elif '.wav' in link_url: + audio_extension = 'wav' else: audio_extension = 'ogg' else: diff --git a/webapp_utils.py b/webapp_utils.py index c8deec424..ce51a8e05 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -1372,6 +1372,8 @@ def get_post_attachments_as_html(base_dir: str, extension = '.mp3' if attach['url'].endswith('.ogg'): extension = '.ogg' + elif attach['url'].endswith('.wav'): + extension = '.wav' elif attach['url'].endswith('.opus'): extension = '.opus' elif attach['url'].endswith('.spx'):