ryanheise / audio_service

Flutter plugin to play audio in the background while the screen is off.
806 stars 480 forks source link

Getting Sample rate, bit depth of stream? #562

Closed xyzbilal closed 3 years ago

xyzbilal commented 3 years ago

Hi, Thanks for your efford and great product. I implemented a network radio player for and added some visuals that stream is playing and I call this widget while mediastream position stream running. I build widget with randoms that doesnt give actual data but I wonder if there is a change to show it actual data. thanks for everything.

my widget shows activity;

  Widget visualize(context) {
    return SizedBox(
      width: MediaQuery.of(context).size.width / 1.5,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.end,
        mainAxisSize: MainAxisSize.min,
        children: [
          for (int i = 0; i < 30; i++) ...[
            Expanded(
              child: ListView.builder(
                  physics: NeverScrollableScrollPhysics(),
                  reverse: true,
                  itemCount: Random().nextInt(20),
                  itemBuilder: (ctx, index) {
                    final opac = 1 - 0.05 * index;
                    int green = 255 - (index * 12);
                    int red = index * 12;
                    return Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            color: Color.fromRGBO(red,green,0,opac > 0? opac: 0), //Colors.green.withRed(255-(20*index)).withOpacity(opac>0?opac:0),
                            width: 5,
                            height: 2,
                          ),
                          SizedBox(
                            height: 1,
                          )
                        ]);
                  }),
            ),
          ]
        ],
      ),
    );
  }
Ekran Resmi 2020-12-20 15 13 53
github-actions[bot] commented 3 years ago

This issue was automatically closed because it did not follow the issue template.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with audio_service.