Files
UxPlay/renderers/audio_renderer.h
Jacob Pritchett 6039f53976 Add -artp option for audio RTP output
Add a new -artp command-line option that routes decoded audio to an RTP
stream instead of the local audio sink, following the existing -vrtp
pattern for video.

Usage: uxplay -artp "pt=96 ! udpsink host=127.0.0.1 port=5002"

The implementation:
- Decodes audio (AAC-ELD/ALAC) to PCM
- Converts to S16BE format required by rtpL16pay
- Preserves volume control for iOS volume adjustment
- Sends L16 RTP packets (16-bit signed big-endian, 44100Hz, stereo)
2026-01-18 00:27:25 -07:00

49 lines
1.7 KiB
C

/**
* RPiPlay - An open-source AirPlay mirroring server for Raspberry Pi
* Copyright (C) 2019 Florian Draschbacher
* Modified for:
* UxPlay - An open-source AirPlay mirroring server
* Copyright (C) 2021-23 F. Duncanh
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AUDIO_RENDERER_H
#define AUDIO_RENDERER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include "../lib/logger.h"
bool gstreamer_init();
void audio_renderer_init(logger_t *logger, const char* audiosink, const bool *audio_sync, const bool *video_sync, const char *artp_pipeline);
void audio_renderer_start(unsigned char* compression_type);
void audio_renderer_stop();
void audio_renderer_render_buffer(unsigned char* data, int *data_len, unsigned short *seqnum, uint64_t *ntp_time);
void audio_renderer_set_volume(double volume);
void audio_renderer_flush();
void audio_renderer_destroy();
unsigned int audio_renderer_listen(void *loop, int id);
#ifdef __cplusplus
}
#endif
#endif //AUDIO_RENDERER_H