<commit_before># -*- encoding: utf-8; py-indent-offset: 4 -*-

# Copyright (c) 2012, <NAME> https://github.com/JamesHarrison/openob

import sys
import time
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject

#Gst.debug_set_active(True)
#Gst.debug_set_default_threshold(3)

GObject.threads_init()
Gst.init(None)


class RTPreceiver:
    def __init__(self, caps='', audio_device='hw:0', base_port=3000,
                 ipv6=True,  bitrate=64, jitter_buffer=150):
        """Sets up a new RTP receiver"""

        self.pipeline = Gst.Pipeline()
        self.started = False

        self.sink = Gst.ElementFactory.make("alsasink", None)
        self.sink.set_property('device', audio_device)
        self.sink.set_property('buffer-time', 150000)
        self.sink.set_property('latency-time', 10000)

        self.audioconvert = Gst.ElementFactory.make("audioconvert", None)
        self.audioresample = Gst.ElementFactory.make("audioresample", None)
        self.audioresample.set_property('quality', 9)

        self.decoder = Gst.ElementFactory.make("opusdec", "decoder")
        self.decoder.set_property('use-inband-fec', True)  # FEC
        self.decoder.set_property('plc', True)  # Packet loss concealment<commit_msg>testing receiver without sync (hopefully fix audio resyncing)<commit_after># -*- encoding: utf-8; py-indent-offset: 4 -*-

# Copyright (c) 2012, <NAME> https://github.com/JamesHarrison/openob

import sys
import time
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject

#Gst.debug_set_active(True)
#Gst.debug_set_default_threshold(3)

GObject.threads_init()
Gst.init(None)


class RTPreceiver:
    def __init__(self, caps='', audio_device='hw:0', base_port=3000,
                 ipv6=True,  bitrate=64, jitter_buffer=150):
        """Sets up a new RTP receiver"""

        self.pipeline = Gst.Pipeline()
        self.started = False

        self.sink = Gst.ElementFactory.make("alsasink", None)
        self.sink.set_property('device', audio_device)
#        self.sink.set_property('buffer-time', 150000)
#        self.sink.set_property('latency-time', 10000)
        self.sink.set_property('sync', False)

        self.audioconvert = Gst.ElementFactory.make("audioconvert", None)
        self.audioresample = Gst.ElementFactory.make("audioresample", None)
        self.audioresample.set_property('quality', 9)

        self.decoder = Gst.ElementFactory.make("opusdec", "decoder")
        self.decoder.set_property('use-inband-fec', True)  # FEC
        self.decoder.set_property('plc', True)  # Packet loss concealment
{'fraction_non_alphanumeric': 0.13709677419354838, 'fraction_numerical': 0.02457757296466974, 'mean_word_length': 3.6024734982332154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7614605', 'n_tokens_mistral': 931, 'n_tokens_neox': 852, 'n_words': 158}