sound

package
v0.0.0-...-e8f3219 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2019 License: Unlicense Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInstrumentNotFound = errors.New("instrument was not found in the database")

ErrInstrumentNotFound is an error thrown when an instrument was not found in the database

View Source
var ErrUnexpectedRowsAffectedCount = errors.New("unexpected rows affected count")

ErrUnexpectedRowsAffectedCount is an error thrown when updating a sound and rows affected count is not expected

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

Handlers defines a handler for sound

func NewHandlers

func NewHandlers(logger *log.Logger, db *sql.DB, repository files.Repository) *Handlers

NewHandlers creates a new handler for sound

func (*Handlers) CreateSound

func (h *Handlers) CreateSound(ctx context.Context, user session.User, pSound prospectSound, strategy soundProcessingStrategy) (*models.Sound, error)

CreateSound creates a sound with a validated prospect audio.

func (*Handlers) PostSound

func (h *Handlers) PostSound(c *gin.Context)

PostSound creates an audio, analizes it and stores it in the database

func (*Handlers) ProcessSound

func (h *Handlers) ProcessSound(userID, instrumentID, soundUUID, extension string, soundID int64) error

ProcessSound finds a sound file and reads it to extract the frequencies with the intensity and saves it to the frequency table

func (*Handlers) ProcessSoundNoFK

func (h *Handlers) ProcessSoundNoFK(userID, instrumentID, soundUUID, extension string, soundID int64) error

ProcessSoundNoFK does the same that ProcessSound but disables the foreign key for faster insertion

func (*Handlers) Retrieve

func (h *Handlers) Retrieve(c *gin.Context)

FindSound find an audio clip in the database

func (*Handlers) Routes

func (h *Handlers) Routes(rg *gin.RouterGroup)

Routes initializes the routes for the audio handlers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL