首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Java Tale

    厌倦了空指针异常?考虑使用Java SE 8的Optional!

    = null){ Soundcard soundcard = computer.getSoundcard(); if(soundcard ! = new Soundcard(); Optional<Soundcard> sc = Optional.of(soundcard); 如果soundcard为null,NullPointerException 而不必记得做一个空检查,如下所示: SoundCard soundcard = ...; if(soundcard ! = null){ System.out.println(soundcard); } 您可以使用以下ifPresent()方法: Optional<Soundcard> soundcard = ... 为空): Soundcard soundcard = maybeSoundcard.orElse(new Soundcard("defaut")); 类似地,您可以使用该orElseThrow()方法,

    1.8K31发布于 2020-03-16
  • 来自专栏全志嵌入式那些事

    全志V853在tina+audio+dvr下如何实现多路mic采集和回声消除?

    ,format = “i2s”; //根据tp9930的输出格式选择dsp模式或者i2s模式 soundcard-mach,frame-master = <&daudio1_codec>; soundcard-mach ,bitclock-master = <&daudio1_codec>; /* soundcard-mach,frame-inversion; / / soundcard-mach,bitclock-inversion ; / soundcard-mach,slot-num = <16>; //tp9930默认配置16声道slot soundcard-mach,slot-width = <16>; //声道位深16bit ,主机配置为daudio1_cpu soundcard-mach,pll-fs = <1>; / pll freq = 24.576M or 22.5792M * pll-fs / soundcard-mach ,mclk-fs = <0>; / mclk freq = pcm rate * mclk-fs */ //不需要mclk时钟 }; daudio1_codec: soundcard-mach,codec

    59110编辑于 2024-02-02
  • 来自专栏为数不多的Android技巧

    [译]厌倦了NullPointException?Optional拯救你!

    = null){ Soundcard soundcard = computer.getSoundcard(); if(soundcard ! > sc = Optional.empty(); 包含非空值的Optional SoundCard soundcard = new Soundcard(); Optional<Soundcard> sc = Optional.of(soundcard); 一旦soundcard是null,这段代码会立即抛出一个NullPointException(而不是等你以后你访问这个空的soundcard对象的时候 ) 可能为空的Optional Optional<Soundcard> sc = Optional.ofNullable(soundcard); 如果soundcard是null那么这个Optional = null){ System.out.println(soundcard); } 现在,可以使用ifPresent()方法,如下: Optional<Soundcard> soundcard =

    1.3K20发布于 2018-09-05
  • 来自专栏程序猿阿朗的专栏

    Jdk14都要出了,还不能使用 Optional优雅的处理空指针?

    /** * 计算机 */ @Data class Computer { private Optional<SoundCard> soundCard; } /** * 声卡 */ @Data class SoundCard { private Optional<Usb> usb; } /** * USB */ @Data class Usb { private String soundCard = new SoundCard(); Usb usb = new Usb(); usb.setVersion("2.0"); soundCard.setUsb (Optional.ofNullable(usb)); Optional<SoundCard> optionalSoundCard = Optional.ofNullable(soundCard (usb=Optional[Usb(version=2.0)]) SoundCard(usb=Optional[Usb(version=2.0)]) ----------------- 9.

    1.1K30发布于 2019-11-04
  • 来自专栏Java极客技术

    对象构造神器,建造者模式实操分享

    private String memory; /**主板*/ private String mainBoard; /**声卡*/ private String soundCard = " + soundCard + "]"; } } 再创建一个建造类,也就是负责组装电脑,内容如下: /** * 建造者类 */ public class ComputerBuilder ) { isSoundCard = soundCard; return this; } public Integer getAddMemory() { = "英特尔声卡"; }else{ this.soundCard = "不配置声卡"; } //默认4G 内存 = " + soundCard + "]"; } } 最后,编写一个客户端,测试一下,内容如下: public class BuilderClient { public static

    48310编辑于 2022-12-02
  • 来自专栏开源519

    设计模式 - 访问者模式

    ); private: std::string mName; };驱动访问者是具体的访问者类,其会实现VisitGpu、VisitSoundCard但是其只关心Gpu和SoundCard的驱动属性 而功能访问者只关心Gpu和SoundCard的功能属性。 访问者基类统一访问配件的接口,在CComputePartBase的Accept()接口的实现中会被使用到。 ) { if (NULL == soundCard) { DRV_LOGE("soundCard is NULL! \n"); } if (soundCard->CheckDriver() <= 0) { DRV_LOG("%s of SoundCard Failed! \n", this->GetName().c_str()); } else { DRV_LOG("%s of SoundCard Success!

    54310编辑于 2022-05-03
  • 来自专栏开源519

    C++设计模式 - 访问者模式

    ); private: std::string mName; }; 驱动访问者是具体的访问者类,其会实现VisitGpu、VisitSoundCard但是其只关心Gpu和SoundCard 而功能访问者只关心Gpu和SoundCard的功能属性。 ) { if (NULL == soundCard) { DRV_LOGE("soundCard is NULL! \n"); } if (soundCard->CheckDriver() <= 0) { DRV_LOG("%s of SoundCard Failed! \n", this->GetName().c_str()); } else { DRV_LOG("%s of SoundCard Success!

    45620编辑于 2022-12-01
  • 来自专栏Linux内核深入分析

    Linux音频驱动-Card创建

    数据结构 声卡的主要数据结构struct snd_card struct snd_card { int number; /* number of soundcard (index to string of this card */ char driver[16]; /* driver name */ char shortname[32]; /* short name of this soundcard */ char longname[80]; /* name of this soundcard */ char mixername[80]; /* mixer name */ char components space */ struct module *module; /* top-level module */ void *private_data; /* private data for soundcard .number: soundcard的序号,通常为0。 .id: card的标识符,通常是字符串形式。

    3.5K11发布于 2020-03-24
  • 来自专栏JAVA乐园

    Optional 类解决空指针异常

    = null){ Soundcard soundcard = computer.getSoundcard(); if(soundcard ! = null){ USB usb = soundcard.getUSB(); if(usb ! } } } // ** 正确示范 String version = computer.map(Computer::getSoundcard) .map(Soundcard

    1.2K40发布于 2021-05-17
  • 来自专栏陶然同学博客

    【Java】接口多态练习题

            mb.startPCICard(nc);         //停止网卡         mb.stopPCICard(nc);          //创建声卡对象         SoundCard sc=new SoundCard();           //启动声卡             mb.startPCICard(sc);          //停止声卡             ;   //创建网卡对象         mb.startPCICard(nc); //启动网卡         mb.stopPCICard(nc);      //停止网卡         SoundCard sc=new SoundCard();       //创建声卡对象         mb.startPCICard(sc);  //启动声卡         mb.stopPCICard(sc) 网卡启动 ...");     }     public void stop(){         System.out.println("网卡停止...");     } } class SoundCard

    50920编辑于 2023-02-24
  • 来自专栏张善友的专栏

    学习笔记]快速开发Hibernate

    varchar(50) default NULL,   `display` varchar(50) default NULL,   `memory` varchar(50) default NULL,   `soundcard             not-null="false"             length="50"         />         <property             name="<em>Soundcard</em> "             column="<em>soundcard</em>"             type="string"             not-null="false"             length

    84460发布于 2018-01-29
  • 来自专栏学习之旅

    【教程】MacOS绕过Apple Developer ID获取麦克风权限

    python -m venv traysource tray/bin/activatepip install -i https://pypi.org/simple pystray pillow numpy SoundCard

    19800编辑于 2026-01-04
  • 来自专栏全栈程序员必看

    libzplay库

    Library will play music directly to soundcard. Simple and easy. Simple, simple, simple … With version 2.00 you can record music from your soundcard.

    1.5K20编辑于 2022-07-25
  • 来自专栏学习之旅

    【工具】制作电脑托盘音乐频谱显示工具

    双击托盘图标打开网站(xfxuezhang.cn)环境要求Windows 10/11Python 3.8+(推荐 3.10+)安装依赖pip install numpy pillow pystray SoundCard

    27310编辑于 2025-12-18
  • 来自专栏韦东山嵌入式

    Tina_Linux_音频_开发指南

    _cpu>; /* soundcard-mach,frame-inversion; */ /* soundcard-mach,bitclock-inversion; */ soundcard-mach, slot-num = <2>; soundcard-mach,slot-width = <32>; status = "okay"; daudio0_cpu: soundcard-mach,cpu { */ soundcard-mach,mclk-fs = <0>; /* mclk freq = pcm rate * mclk-fs */ }; daudio0_codec: soundcard-mach _cpu>; /* soundcard-mach,frame-inversion; */ /* soundcard-mach,bitclock-inversion; */ soundcard-mach, ,name = "snddmic"; soundcard-mach,capture_only; status = "disabled"; soundcard-mach,cpu { sound-dai =

    8.4K10编辑于 2023-02-25
  • 来自专栏txp玩Linux

    Linux ALSA声卡驱动之二:声卡的创建

    新版本接口为: 老版本接口说明: /** * snd_card_create - create and initialize a soundcard structure * @idx: card * @module: top level module for locking * @extra_size: allocate this extra size after the main soundcard structure * @card_ret: the pointer to store the created card instance * * Creates and initializes a soundcard

    3.7K10编辑于 2024-01-10
  • 来自专栏C/C++与音视频

    libmad学习进阶3-----基于oss音频驱动架构的一个mp3播放器

    #include<sys/stat.h> #include<fcntl.h> #include<stdlib.h> #include <sys/ioctl.h> #include <sys/soundcard.h

    91740编辑于 2022-06-14
  • 来自专栏生信技能树

    linux 命令中英文对照,收集

    alternative Linux Getty alias Create an alias for Linux commands alsactl Access advanced controls for ALSA soundcard . amidi Perform read/write operation for ALSA RawMIDI ports. amixer Access CLI-based mixer for ALSA soundcard Display print machine hardware name. arecord Just like aplay, it’s a sound recorder and player for ALSA soundcard

    2.7K60发布于 2018-03-05
  • 来自专栏C/C++与音视频

    libmad学习进阶4 -----基于atlas音频驱动架构的MP3播放器

    sys/stat.h> #include<fcntl.h> #include<stdlib.h> #include <sys/ioctl.h> #include <sys/soundcard.h

    1.1K20编辑于 2022-06-14
  • 来自专栏章鱼的慢慢技术路

    用ARM实现音乐电子相册

    include <sys/ioctl.h> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <linux/soundcard.h

    2.4K20发布于 2018-06-04
领券