Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BitRateModes = []BitRateMode{
"ABR",
"CBR",
"VBR",
}
BitRateModes are the modes accepted by the encoder.
var BitRates = []BitRate{
16,
32,
64,
}
BitRates supported by the MP3 encoder.
var ChannelModes = []mp3.ChannelMode{ mp3.Mono, mp3.Stereo, mp3.JointStereo, }
ChannelModes supported by the MP3 encoder.
var Templates embed.FS
Templates holds the HTML/JavaScript/CSS/Images for the web app.
Functions ¶
func ParseChannelMode ¶
func ParseChannelMode(in string) (mp3.ChannelMode, error)
ParseChannelMode translates from the string version of a ChannelMode.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the core tinycast web app with handlers and state.
func (*App) Convert ¶ added in v0.1.2
Convert is a handler which re-encodes an audio stream to MP3 on the fly.
type BitRate ¶
type BitRate int
BitRate used to encode an audio file.
func ParseBitRate ¶
ParseBitRate converts a string version of BitRate.
type BitRateMode ¶
type BitRateMode string
BitRateMode describes how the MP3 encoder should apply bit rate limits.
func ParseBitRateMode ¶
func ParseBitRateMode(in string) (BitRateMode, error)
ParseBitRateMode returns a BitRateMode if it matches the given string or an error.
func (BitRateMode) ToMp3BitRateMode ¶
func (brm BitRateMode) ToMp3BitRateMode(br BitRate) mp3.BitRateMode
ToMp3BitRateMode converts a BitRateMode and BitRate to an mp3.BitRateMode.
type ConversionConfig ¶
type ConversionConfig struct { URL string BitRateMode BitRateMode BitRate BitRate ChannelMode mp3.ChannelMode }
ConversionConfig holds the desired conversion for an audio file.
func BindConversionConfig ¶
func BindConversionConfig(c *gin.Context) (ConversionConfig, error)
BindConversionConfig captures and validates a ConversionConfig passed in query parameters.
func (ConversionConfig) ToQueryValues ¶
func (cfg ConversionConfig) ToQueryValues() url.Values
ToQueryValues translates a ConversionCongig to the same query parameters expected by BindConversionConfig.
type Pagination ¶
type Pagination struct {
// contains filtered or unexported fields
}
Pagination represents a location in a sequences of paginated results.
func (Pagination) CurrentPage ¶
func (p Pagination) CurrentPage() int
CurrentPage returns the current page in the result set.
func (Pagination) FirstItem ¶
func (p Pagination) FirstItem() int
FirstItem returns the offset of the first item for the current page in the result set.
func (Pagination) LastPage ¶
func (p Pagination) LastPage() int
LastPage returnss the last page in the result set.
func (Pagination) NextPage ¶
func (p Pagination) NextPage() int
NextPage returns the subsequent page in the result set.
func (Pagination) NumPages ¶
func (p Pagination) NumPages() int
NumPages returns the number of pages in the result set.
func (Pagination) Pages ¶
func (p Pagination) Pages() []Page
Pages returns a slide of Page elements.
func (Pagination) PreviousPage ¶
func (p Pagination) PreviousPage() int
PreviousPage returns the preceding page in the result set.