File: hl_encoder.py

package info (click to toggle)
python-opuslib 3.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: python: 1,201; makefile: 47
file content (30 lines) | stat: -rw-r--r-- 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
#

"""Tests for a high-level Decoder object"""

import unittest

import opuslib

__author__ = 'Никита Кузнецов <self@svartalf.info>'
__copyright__ = 'Copyright (c) 2012, SvartalF'
__license__ = 'BSD 3-Clause License'


class EncoderTest(unittest.TestCase):

    def test_create(self):
        try:
            opuslib.Encoder(1000, 3, opuslib.APPLICATION_AUDIO)
        except opuslib.OpusError as ex:
            self.assertEqual(ex.code, opuslib.BAD_ARG)

        opuslib.Encoder(48000, 2, opuslib.APPLICATION_AUDIO)

    @classmethod
    def test_reset_state(cls):
        encoder = opuslib.Encoder(48000, 2, opuslib.APPLICATION_AUDIO)
        encoder.reset_state()