Skip to content

op_open_live() failure: Input/output error #1

@IAmSp33d11

Description

@IAmSp33d11

Running the following C code on Arch Linux

#include "../include/simpleaudio.h"`
#include <stdio.h>

int main() {
    init_ao();
    printf("Simple Audio Player library is successfully included!\n");
    int ret = play_sync("audio/music.mp3", 100);
    if (ret == -1) {
        printf("Failed to play audio!");
    }
    destroy_ao();
    return 0;

I get this output

op_open_live() failure: Input/output error

Unless I run it as root.

Then I get the following and it plays the audio.

Simple Audio Player library is successfully included!

this is my Makefile

BUILD_DIR := build
SOURCE_DIR := src
INCLUDE_DIR := include

all : dirs main

main: $(SOURCE_DIR)/main.c
	gcc -o $(BUILD_DIR)/main $(SOURCE_DIR)/main.c -L$(INCLUDE_DIR) -lsimpleaudio -lmpg123 -lao -lpthread -lm

dirs:
	mkdir -p $(INCLUDE_DIR)
	mkdir -p $(BUILD_DIR)
	mkdir -p $(SOURCE_DIR)

.PHONY : clean
clean:
	rm -r $(BUILD_DIR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions