Skip to content

ISoundInputStream#

Base interface for representing sound input streams of different formats

Header:#include <AUI/Audio/ISoundInputStream.h>
CMake:aui_link(my_target PUBLIC aui::audio)

Detailed Description#

Experimental Feature

This API is experimental. Experimental APIs are likely to contain bugs, might be changed or removed in the future.

An ISoundInputStream is an IInputStream of raw PCM samples plus a description of them (info). Implement it to feed IAudioPlayer with generated or custom decoded audio, see Custom sound sources.

ISoundInputStream::fromUrl opens a url and picks a decoder (WAV, then Ogg Vorbis). It throws aui::audio::ABadFormatException if neither fits. Small local files (up to 100 KiB) are cached in memory.

Public Methods#

info#


virtual AAudioFormat ISoundInputStream::info()

Get general info about sound stream

Returns
AAudioFormat containing info about sound stream

Examples:

examples/basic/hello_world/src/main.cpp

Console Hello World Example — Basic CLI Hello World application.

static constexpr auto LOG_TAG = "MyApp";

AUI_ENTRY {
    ALogger::info(LOG_TAG) << "Hello world!";
    return 0;
}
examples/app/notes/src/main.cpp

Notes App — Note taking app that demonstrates usage of AListModel, AProperty, user data saving and loading.

                return;
            }
            aui::from_json(AJson::fromStream(AFileInputStream("notes.json")), mNotes);
        } catch (const AException& e) {
            ALogger::info(LOG_TAG) << "Can't load notes: " << e;
        }
    }
    /// [load]

    /// [save]
examples/ui/contacts/src/main.cpp

AUI Contacts — Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

                                return groupLetter(lhs->displayName) == groupLetter(rhs->displayName);
                            }), AVerticalLayout) {
            auto firstContact = *ranges::begin(group);
            auto firstLetter = groupLetter(firstContact->displayName);
            ALogger::info("Test") << "Computing view for group " << AString(1, firstLetter);
            return Vertical {
                Label { firstLetter } AUI_OVERRIDE_STYLE {
                                        Opacity(0.5f),
                                        Padding { 12_dp, 0, 4_dp },
                                        Margin { 0 },
examples/ui/views/src/ExampleWindow.cpp

Views Example — All-in-one views building example.

                                                       "Title",
                                                       "Message",
                                                       AMessageBox::Icon::NONE,
                                                       AMessageBox::Button::OK);
                                     ALogger::info("Example") << "Response: " << int(response);
                                     /// [AMessageBox]
                                 }),
                    _new<AButton>("Cause assertion fail")
                        .connect(&AView::clicked, this, [&] { AUI_ASSERT_NO_CONDITION("assertion fail"); }),
                    _new<AButton>("Cause hang")
examples/ui/embedded_sdl/src/main.cpp

SDL3 — This code demonstrates how to integrate the AUI Framework with SDL3 to create a window with OpenGL rendering.

            _new<ATextField>(),
            Button {
                .content = Label { "Click me" },
                .onClick = [] {
                    ALogger::info("Test") << "Hello world!";
                }
            }
        }
    });
    /// [UI]