scraibe.app package

Submodules

scraibe.app.gradio_app module

Gradio Audio Transcription App.

This module provides an interface to transcribe audio files using the Scraibe model. Users can either upload an audio file or record their speech live for transcription. The application supports multiple languages and provides options to specify the number of speakers and the language of the audio.

scraibe.app.gradio_app.LANGUAGES

A list of supported languages for transcription.

Type:

list

Usage:

Run this script to start the Gradio web interface for audio transcription.

class scraibe.app.gradio_app.GradioTranscriptionInterface(model: Scraibe)[source]

Bases: object

Interface handling the interaction between Gradio UI and the Audio Transcription system.

__init__(model: Scraibe)[source]

Initializes the GradioTranscriptionInterface with a transcription model.

Parameters:

model (Scraibe) – Model responsible for audio transcription tasks.

auto_transcribe(source, num_speakers: int, translation: bool, language: str)[source]

Shortcut method for the Scraibe task.

Returns:

Transcribed text (str), JSON output (dict)

Return type:

tuple

perform_diarisation(source, num_speakers)[source]

Shortcut method for the Diarisation task.

Returns:

JSON output of diarisation result.

Return type:

str

transcribe(source, translation, language)[source]

Shortcut method for the Transcribe task.

Returns:

Transcribed text.

Return type:

str

scraibe.app.gradio_app.gradio_Interface(model: Scraibe | None = None)[source]

scraibe.app.qtfaststart module

This file contains a modified version of qtfaststart by qtfaststart https://github.com/danielgtaylor/qtfaststart/tree/master

All credit goes to the original author. Copyright (C) 2008 - 2013 Daniel G. Taylor <dan@programmer-art.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class scraibe.app.qtfaststart.Atom(name, position, size)

Bases: tuple

name

Alias for field number 0

position

Alias for field number 1

size

Alias for field number 2

exception scraibe.app.qtfaststart.FastStartException[source]

Bases: Exception

Raised when something bad happens during processing.

exception scraibe.app.qtfaststart.FastStartSetupError[source]

Bases: FastStartException

Rasised when asked to process a file that does not need processing

exception scraibe.app.qtfaststart.MalformedFileError[source]

Bases: FastStartException

Raised when the input file is setup in an unexpected way

exception scraibe.app.qtfaststart.UnsupportedFormatError[source]

Bases: FastStartException

Raised when a movie file is recognized as a format not supported.

scraibe.app.qtfaststart._ensure_valid_index(index)[source]

Ensure the minimum viable atoms are present in the index.

Raise FastStartException if not.

scraibe.app.qtfaststart._find_atoms_ex(parent_atom, datastream)[source]

Yield either “stco” or “co64” Atoms from datastream. datastream will be 8 bytes into the stco or co64 atom when the value is yielded.

It is assumed that datastream will be at the end of the atom after the value has been yielded and processed.

parent_atom is the parent atom, a ‘moov’ or other ancestor of CO atoms in the datastream.

scraibe.app.qtfaststart._read_atom_ex(datastream)[source]

Read an Atom from datastream

scraibe.app.qtfaststart._read_atoms(datastream)[source]

Read atoms until an error occurs

scraibe.app.qtfaststart.find_atoms(size, datastream)[source]

Compatibilty interface for _find_atoms_ex

scraibe.app.qtfaststart.get_chunks(stream, chunk_size, limit)[source]
scraibe.app.qtfaststart.get_index(datastream)[source]

Return an index of top level atoms, their absolute byte-position in the file and their size in a list:

index = [

(“ftyp”, 0, 24), (“moov”, 25, 2658), (“free”, 2683, 8), …

]

The tuple elements will be in the order that they appear in the file.

scraibe.app.qtfaststart.process(infilename, limit=inf)[source]

Convert a Quicktime/MP4 file for streaming by moving the metadata to the front of the file. This method writes a new file.

If limit is set to something other than zero it will be used as the number of bytes to write of the atoms following the moov atom. This is very useful to create a small sample of a file with full headers, which can then be used in bug reports and such.

scraibe.app.qtfaststart.read_atom(datastream)[source]

Read an atom and return a tuple of (size, type) where size is the size in bytes (including the 8 bytes already read) and type is a “fourcc” like “ftyp” or “moov”.

Module contents